ELC in dev
ELC-lang
载入中...
搜索中...
未找到
all_defs.cpp
浏览该文件的文档.
1#line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/all"
2//all
3//at namespace ::
4/*
5未完成的elc解释器include文件
6由steve02081504与Alex0125设计、编写
7转载时请在不对此文件做任何修改的同时注明出处
8项目地址:https://github.com/steve02081504/ELC
9*/
10//tool reg : \n[^\n]+\d+ (\S+)\n -> \n\t#include \"\1\"\n
11#if !defined(ELC_ALL)
12 #define ELC_ALL
13 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base"
14 //base
15 //at namespace ::
16 /*
17 未完成的elc解释器include文件
18 由steve02081504与Alex0125设计、编写
19 转载时请在不对此文件做任何修改的同时注明出处
20 项目地址:https://github.com/steve02081504/ELC
21 */
22 #if !defined(ELC_BASE)
23 #define ELC_BASE
24 //原base的一小部分,但由于过于底层,底层到API定义都需要使用。。
25 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base_defs"
26 //base_defs
27 //at namespace ::
28 /*
29 未完成的elc解释器include文件
30 由steve02081504与Alex0125设计、编写
31 转载时请在不对此文件做任何修改的同时注明出处
32 项目地址:https://github.com/steve02081504/ELC
33 */
34 #if !defined(ELC_BASE_DEFS)
35 #define ELC_BASE_DEFS
36 #define __builtin_is_my_dick_still_there() true
37 #include <cstddef>//nullptr_t
38 #include <cstdlib>//exit、size_t
39 #include <new>//operator new(T*)、launder
40 #include <algorithm>//max、min
41 #include <type_traits>//enable_if等
42 #include <typeinfo>//RTTI
43 #include <cmath>//sqrt
44 #include <cfenv>//rounding
45 #include <ranges>
46 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/_body.hpp"
47 //_body.hpp
48 //at namespace ::
49 /*
50 未完成的elc解释器base_defs文件
51 由steve02081504与Alex0125设计、编写
52 转载时请在不对此文件做任何修改的同时注明出处
53 项目地址:https://github.com/steve02081504/ELC
54 */
55 //include default_data_type:基础数据类型定义
56 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/default_data_type.hpp"
57 //default_data_type.hpp
58 /*
59 未完成的elc解释器_share文件
60 由steve02081504与Alex0125设计、编写
61 转载时请在不对此文件做任何修改的同时注明出处
62 项目地址:https://github.com/steve02081504/ELC
63 */
64 namespace elc{
65 /*ELC内部string统一采用char_t宽字符,使用setlocale(LC_ALL,"en_US.utf8")下的UTF编码。*/
66 typedef char32_t char_t;
67 /*ELC内部钦定int_t类型*/
68 typedef int64_t int_t;
69 /*ELC内部钦定uint_t类型*/
70 typedef uint64_t uint_t;
71 /*ELC内部钦定float_t类型*/
72 typedef double float_t;
73 /*ELC内部钦定float_size_t类型,用以描述内存大小的浮点状况*/
74 typedef long double float_size_t;
75 }
76
77 //file_end
78
79 #line 10 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/_body.hpp"
80 namespace elc::defs{ //在elc::defs中定义内容
81 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
82 //_defs.hpp
83 /*
84 未完成的elc解释器basic文件
85 由steve02081504与Alex0125设计、编写
86 转载时请在不对此文件做任何修改的同时注明出处
87 项目地址:https://github.com/steve02081504/ELC
88 */
89 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
90 //_defs.hpp
91 /*
92 未完成的elc解释器_share文件
93 由steve02081504与Alex0125设计、编写
94 转载时请在不对此文件做任何修改的同时注明出处
95 项目地址:https://github.com/steve02081504/ELC
96 */
97
98 //undefs at "_undefs.hpp"
99
100 //set ELC_WARNING_LEVEL default to 4(max)
101 #if !defined(ELC_WARNING_LEVEL)
102 #define ELC_WARNING_LEVEL 4
103 #endif
104
105 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/basic_environment.hpp"
106 //basic_environment.hpp
107 /*
108 未完成的elc解释器_share文件
109 由steve02081504与Alex0125设计、编写
110 转载时请在不对此文件做任何修改的同时注明出处
111 项目地址:https://github.com/steve02081504/ELC
112 */
113
116 #define BIT_POSSIBILITY 2
117
118 //file_end
119
120 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
121
122 #if defined(_MSC_VER)
123 #pragma warning(push,ELC_WARNING_LEVEL)
124 #pragma warning(disable:4099)//class与struct混用警告diss
125 #pragma warning(disable:26812)//enum class安利diss.
126 #pragma warning(disable:4584)//重复子类警告diss
127 #pragma warning(disable:4250)//域控制继承警告diss
128 #pragma warning(disable:26432)//不完全默认方法警告diss
129 #pragma warning(disable:26435)//virtual override方法警告diss
130 #pragma warning(disable:26481)//容器安利diss
131 #pragma warning(disable:26446)//gsl::at安利diss
132 #pragma warning(disable:26434)//方法覆盖警告diss
133 #pragma warning(disable:26429)//gsl::not_null安利diss
134 #pragma warning(disable:26471)//对void*进行static_cast安利diss
135 #pragma warning(disable:26474)//隐式指针转换显式cast警告diss
136 #pragma warning(disable:26473)//相同指针显式cast警告diss
137 #pragma warning(disable:26456)//隐藏非虚运算符警告diss
138 #pragma warning(disable:26485)//数组作指针警告diss
139 #pragma warning(disable:26490)//reinterpret_cast警告diss
140 #pragma warning(disable:26472)//static_cast窄幅转换警告diss
141 #pragma warning(disable:26482)//非常数数组索引警告diss
142 #pragma warning(disable:26493)//c_cast转换警告diss:虽然有用但是太烦了,爬
143 #endif
144 #if defined(_MSC_VER)
145 #define suppress_msvc_warning(...) __pragma(warning(suppress:__VA_ARGS__))
146 #define disable_msvc_warning(...) __pragma(warning(disable:__VA_ARGS__))
147 #define push_msvc_warning() __pragma(warning(push))
148 #define pop_msvc_warning() __pragma(warning(pop))
149 #define push_and_disable_msvc_warning(...) push_msvc_warning() disable_msvc_warning(__VA_ARGS__)
150 #else
151 #define suppress_msvc_warning(...)
152 #define disable_msvc_warning(...)
153 #define push_msvc_warning()
154 #define pop_msvc_warning()
155 #define push_and_disable_msvc_warning(...)
156 #endif
157 //
158 #if defined(ELC_VOID_NAME)
159 #undef void
160 #endif
161
162 // #define often_noexcept
163 #define noexcept_as(...) noexcept(noexcept((__VA_ARGS__)))//dnmd C艹标准就是没有noexcept_as_auto
164 #define noexcept_as_auto MAGIC//哦现在有了
165 #define constexpr_as(...) MAGIC constexpr//( •̀ ω •́ )✌
166 #define constexpr_as_auto MAGIC MAGIC constexpr//✌( •̀ ω •́ )✌
167
168 #define using_method_from_base_t(name,...) \
169 template<class...Args> requires was_not_an_ill_form(declvalue(base_t).name(declvalue(Args)...))\
170 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(base_t::name(declvalue(Args)...))\
171 {\
172 return base_t::name(forward<Args>(rest)...);\
173 }\
174
175 #define using_method_from_value(name,value_name,...) \
176 template<class...Args> requires was_not_an_ill_form(re_declvalue(value_name).name(declvalue(Args)...))\
177 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(re_declvalue(value_name).name(declvalue(Args)...))\
178 {\
179 return value_name.name(forward<Args>(rest)...);\
180 }\
181
182 #define floop while(__builtin_is_my_dick_still_there())
183 #define enable_adl(name) void name()noexcept=delete
184
185 #define re_declvalue(...) (declvalue(decltype(__VA_ARGS__)))
186 #define re_decltype(...) (decltype(declvalue(__VA_ARGS__)))
187
188 #define declvalue(...) (::std::declval<__VA_ARGS__>())
189
191 #define template_error(reason) static_assert(template_error_helper<T>,reason)
193 #define template_warning(reason) template_warning_helper<T>(reason)
194
195 //for type_info
196 #define type_info_of(...) base_type_info_t(typeid(__VA_ARGS__))
197 #define type_name_of(...) (type_info_of(__VA_ARGS__).name())
198
199 #define is_common_attribute(name) public attribute<T,name<T>>
200 #define is_special_attribute(name) public attribute<T,name>
201
202 #define has_attribute(...) template_name has_attribute_helper<__VA_ARGS__>()
203 #define not_has_attribute(...) template_name not_has_has_attribute_helper<__VA_ARGS__>()
204
205 //for float_size_t
206 #define float_size_of(...) (float_size_t{sizeof(__VA_ARGS__)})
207 //bitnum_of
208 #define bitnum_of(...) (bitnumof<__VA_ARGS__>)
209
210 //for attribute
211 #define def_common_attribute_with_nothing(name) \
212 template<typename T>\
213 class name{}\
214
215 #define def_special_attribute_with_nothing(name) \
216 class name{}\
217
218 #define common_attribute_t template<class>class
219 #define special_attribute_t class
220
229 #define enable_if(...) class enable_state= ::std::enable_if_t<__VA_ARGS__>
231 #define enabled_by_default class enable_state=void
233 #define disabled_by_default class enable_state= ::std::enable_if_t<false>
235 #define enable_if_not_ill_form(...) class enable_state= ::std::void_t<decltype(__VA_ARGS__)>
237 #define enable_flag class enable_state
238
239 #define was_an_ill_form(...) (!was_not_an_ill_form(__VA_ARGS__))
240 #define was_an_ill_form_with_parameter(...) (!was_not_an_ill_form_with_parameter(__VA_ARGS__))
241 #define was_not_an_ill_form(...) (bool(requires{__VA_ARGS__;}))
242 #define was_not_an_ill_form_and_noexcept(...) (bool(requires{__VA_ARGS__;{__VA_ARGS__}noexcept;}))
243 #define was_not_an_ill_form_with_parameter(...) (bool(requires __VA_ARGS__ ))
244
246 #define recursive_lambda(...) lambda(auto&&lambda_RLSRRS,__VA_ARGS__)
248 #define get_recursive_lambda_caller(name) \
249 lambda_with_catch(&)(auto&&...Args){\
250 return name(name,Args...);\
251 }
253 #define lambda []
255 #define lambda_with_catch(...) [__VA_ARGS__]
257 #define self_recursion(...) lambda_RLSRRS(lambda_RLSRRS,__VA_ARGS__)
258 //recursive_lambda_self_referential_reserved_symbolname
259 #define lambda_RLSRRS _my_jb_super_sb_name_
260
261 #define MAGIC//ahh,ko no tenno da!
262
264 #define nothing
265
267 #define elseif else if
269 #define _big_than_ >
271 #define _small_than_ <
272
273 #if defined(_MSC_VER)
274 #define not !
275 #define and &&
276 #define or ||
277 #endif
278
280 #define INTER_NAMESPACE(NAMESPACENAME) namespace NAMESPACENAME{
282 #define BREAK_NAMESPACE }
283
285 #define template_name template
287 #define type_name class
288
289 #if defined(DEBUG) || defined(_DEBUG)
290 #define not_in_debug 0
291 #else
292 #define not_in_debug 1
293 #endif
294
295 #define es U""
296 #define ec(ch) U ## ch
297
298 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
299 #define ELC_TEST_EVENTNAME(name) stest_eventer _the_stest_eventer__(L""name)
300 #else
301 #define ELC_TEST_EVENTNAME(name)
302 #endif
303
304 #define override_instance_struct \
305 protected:\
306 virtual void abstract_method_unget_this()noexcept_as(instance_struct<this_t>::abstract_method_unget_this())override{instance_struct<this_t>::abstract_method_unget_this();}\
307 virtual void* _abstract_method_copy_get_this()noexcept_as(instance_struct<this_t>::_abstract_method_copy_get_this())override{return instance_struct<this_t>::_abstract_method_copy_get_this();}\
308 virtual void* _abstract_method_get_resize_this(size_t size)noexcept_as(instance_struct<this_t>::instance_struct<this_t>::_abstract_method_get_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_resize_this(size);}\
309 virtual void* _abstract_method_get_forward_resize_this(size_t size)noexcept_as(instance_struct<this_t>::_abstract_method_get_forward_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_forward_resize_this(size);}\
310 virtual size_t abstract_method_get_size_of_get_for_this()noexcept override{return instance_struct<this_t>::abstract_method_get_size_of_get_for_this();}
311
312 #if defined(_WIN32)
313 #define distinctive __declspec(dllexport)
314 #else
315 #define distinctive
316 #endif
317
318 #if defined(_WIN32)
319 #define force_inline __forceinline
320 #elif defined(__GNUC__)
321 #define force_inline __attribute__((always_inline)) inline
322 #else
323 #define force_inline inline
324 #endif
325
326 #if defined(_WIN32)
327 #define with_no_vtable __declspec(novtable)
328 #else
329 #define with_no_vtable
330 #endif
331
332 #define in_consteval (::std::is_constant_evaluated())
333
334 #define no_vtable_struct struct with_no_vtable
335 #define no_vtable_class class with_no_vtable
336
337 //file_end
338
339 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
340
341 //file_end
342
343 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/_body.hpp"
344
345 namespace base{}
346 using namespace base;//导出内容:defs内的名称空间只起到大体名称分组的作用,不进行名称阻拦
347
348 //内存泄露检测
349 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
350 namespace memory{
351 inline void check_memory_lack()noexcept;
352 inline struct distinctive memory_lack_checker_t{
353 ~memory_lack_checker_t(){
354 check_memory_lack();
355 }
356 }memory_lack_checker{};
357 }
358 #endif
359
360 namespace base{
361 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
362 //_body.hpp
363 //at namespace elc::defs::base
364 /*
365 未完成的elc解释器base_defs文件
366 由steve02081504与Alex0125设计、编写
367 转载时请在不对此文件做任何修改的同时注明出处
368 项目地址:https://github.com/steve02081504/ELC
369 */
370 //恭喜你找到elc内大部分语法糖所在地
371 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/template_helper.hpp"
372 //template_helper.hpp
373 //at namespace elc::defs::base
374 /*
375 未完成的elc解释器base_defs文件
376 由steve02081504与Alex0125设计、编写
377 转载时请在不对此文件做任何修改的同时注明出处
378 项目地址:https://github.com/steve02081504/ELC
379 */
383 template<class T>
384 constexpr bool template_error_helper=1000-7==114514;//w.
388 template<class T,class U>
389 [[deprecated("this was a template warning."),nodiscard]]
390 inline auto template_warning_helper(U&&a)noexcept{return 0;}
391
392 //file_end
393
394 #line 10 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
395 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/using_std.hpp"
396 //using_std.hpp
397 //at namespace elc::defs::base
398 /*
399 未完成的elc解释器base_defs文件
400 由steve02081504与Alex0125设计、编写
401 转载时请在不对此文件做任何修改的同时注明出处
402 项目地址:https://github.com/steve02081504/ELC
403 */
404 //从std中导入一些名称.
405 //这不比博人传燃?
406 using ::std::byte;
407 using ::std::size_t;
408
409 using ::std::forward;
410 using ::std::addressof;
411 using ::std::swap;
412 /*
413 如何不用中间变量swap两个值?
414 方法一:
415 a=a+b
416 b=a-b
417 a=a-b
418 方法二:
419 a^=b^=a^=b
420 道理我都懂,可是还是用中间变量快些
421 XD
422 更多方法欢迎补充
423 */
424
425 template<class T>
426 using remove_cvref= ::std::remove_cvref_t<T>;
427 template<class T>
428 using remove_cv= ::std::remove_cv_t<T>;
429 template<class T>
430 using remove_ref= ::std::remove_reference_t<T>;
431 template<bool B,class T,class F>
432 using conditional= ::std::conditional_t<B,T,F>;
433 //
434 using ::std::partial_ordering;
435 using ::std::weak_ordering;
436 using ::std::strong_ordering;
437
438 //file_end
439
440 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
441 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/concept.hpp"
442 //concept.hpp
443 //at namespace elc::defs::base
444 /*
445 未完成的elc解释器base_defs文件
446 由steve02081504与Alex0125设计、编写
447 转载时请在不对此文件做任何修改的同时注明出处
448 项目地址:https://github.com/steve02081504/ELC
449 */
450 //template<typename T,template<typename>constexpr bool name>
451 //concept as_concept=name<T>;
452
453 //file_end
454
455 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
456 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/magic_number.hpp"
457 //magic_number.hpp
458 //at namespace elc::defs::base
459 /*
460 未完成的elc解释器base_defs文件
461 由steve02081504与Alex0125设计、编写
462 转载时请在不对此文件做任何修改的同时注明出处
463 项目地址:https://github.com/steve02081504/ELC
464 */
465 namespace magic_number{
471 constexpr auto gold=0.61803398874989484820458683436563811772030917980576286213544862270526046281890244970720720418939113748475408807538689175212663386222353693179318006076672635443338908659593958290563832266131992829026788067520876689250171169620703222104321626954862629631361443814975870122034080588795445474924618569536486444924104432077134494704956584678850987433944221254487706647809158846074998871240076521705751797883416625624940758906970400028121042762177111777805315317141011704666599146697987317613560067087480710131795236894275219484353056783002287856997829778347845878228911097625003026961561700250464338243776486102838312683303724292675263116533924731671112115881863851331620384005222165791286675294654906811317159934323597349498509040947621322298101726107059611645629909816290555208524790352406020172799747175342777592778625619432082750513121815628551222480939471234145170223735805772786160086883829523045926478780178899219902707769038953219681986151437803149974110692608867429622675756052317277752035361393621076738937645560606059216589466759551900400555908950229530942312482355212212415444006470340565734797663972394949946584578873039623090375033993856210242369025138680414577995698122445747178034173126453220416397232134044449487302315417676893752103068737880344170093954409627955898678723209512426893557309704509595684401755519881921802064052905518934947592600734852282101088194644544222318891319294689622002301443770269923007803085261180754519288770502109684249362713592518760777884665836150238913493333122310533923213624319263728910670503399282265263556209029798642472759772565508615487543574826471814145127000602389016207773224499435308899909501680328112194320481964387675863314798571911397815397807476150772211750826945863932045652098969855567814106968372884058746103378105444390943683583581381131168993855576975484149144534150912954070050194775486163075422641729394680367319805861833918328599130396072014455950449779212076124785645916160837059498786006970189409886400764436170933417270919143365013715;//精度2000(然而只是double而已.)
472
476 constexpr auto gold_of_resize=gold+1;//精度2000——大概
477
479 constexpr auto pi = 3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230664709384460955058223172535940812848111745028410270193852110555964462294895493038196442881097566593344612847564823378678316527120190914564856692346034861045432664821339360726024914127372458700660631558817488152092096282925409171536436789259036001133053054882046652138414695194151160943305727036575959195309218611738193261179310511854807446237996274956735188575272489122793818301194912983367336244065664308602139494639522473719070217986094370277053921717629317675238467481846766940513200056812714526356082778577134275778960917363717872146844090122495343014654958537105079227968925892354201995611212902196086403441815981362977477130996051870721134999999837297804995105973173281609631859502445945534690830264252230825334468503526193118817101000313783875288658753320838142061717766914730359825349042875546873115956286388235378759375195778185778053217122680661300192787661119590921642019893809525720106548586327886593615338182796823030195203530185296899577362259941389124972177528347913151557485724245415069595082953311686172785588907509838175463746493931925506040092770167113900984882401285836160356370766010471018194295559619894676783744944825537977472684710404753464620804668425906949129331367702898915210475216205696602405803815019351125338243003558764024749647326391419927260426992279678235478163600934172164121992458631503028618297455570674983850549458858692699569092721079750930295532116534498720275596023648066549911988183479775356636980742654252786255181841757467289097777279380008164706001614524919217321721477235014144197356854816136115735255213347574184946843852332390739414333454776241686251898356948556209921922218427255025425688767179049460165346680498862723279178608578438382796797668145410095388378636095068006422512520511739298489608412848862694560424196528502221066118630674427862203919494504712371378696095636437191728746776465757396241389086583264599581339047802759009;//精度2000
480
482 constexpr auto e = 2.71828182845904523536028747135266249775724709369995957496696762772407663035354759457138217852516642742746639193200305992181741359662904357290033429526059563073813232862794349076323382988075319525101901157383418793070215408914993488416750924476146066808226480016847741185374234544243710753907774499206955170276183860626133138458300075204493382656029760673711320070932870912744374704723069697720931014169283681902551510865746377211125238978442505695369677078544996996794686445490598793163688923009879312773617821542499922957635148220826989519366803318252886939849646510582093923982948879332036250944311730123819706841614039701983767932068328237646480429531180232878250981945581530175671736133206981125099618188159304169035159888851934580727386673858942287922849989208680582574927961048419844436346324496848756023362482704197862320900216099023530436994184914631409343173814364054625315209618369088870701676839642437814059271456354906130310720851038375051011574770417189861068739696552126715468895703503540212340784981933432106817012100562788023519303322474501585390473041995777709350366041699732972508868769664035557071622684471625607988265178713419512466520198918006308407507245458379639351364421067750539471789004518357551541252235905906872648786357525419112888773717663748602766063496035367947026923229718683277173932361920077745221262475186983349515101986426988784717193966497690708252174233656627259284406204302141137199227852699846988477023238238400556555178890876613601304770984386116870523105531491625172837327286760072481729876375698163354150746088386636406934704372066886512756882661497307886570156850169186474885416791545965072342877306998537139043002665307839877638503238182155355973235306860430106757608389086270498418885951380910304235957824951439885901131858358406674723702971497850841458530857813391562707603563907639473114554958322669457024941398316343323789759556808568362972538679132750555425244919435891284050452269538121791319145135009938463117740179715122837854601160359554028644059;//精度2000
483
484 constexpr auto god=72;
485
487 template<typename T> requires ::std::is_arithmetic_v<T>
488 [[nodiscard]]force_inline constexpr bool is_negative(T x)noexcept{
489 if constexpr(::std::is_signed_v<T>){
490 if constexpr(::std::is_floating_point_v<T>)
491 return ::std::signbit(x);
492 else
493 return x<0;
494 }
495 else
496 return false;
497 }
499 template<typename T> requires ::std::is_arithmetic_v<T>
500 [[nodiscard]]force_inline constexpr T copy_as_negative(auto x,bool negative=1)noexcept{
501 if constexpr(::std::is_signed_v<decltype(x)>){
502 if constexpr(::std::is_floating_point_v<decltype(x)>)
503 return(T)::std::copysign(x,negative?-1:1);
504 else
505 return(T)negative?T{}-x:x;
506 }
507 else
508 return x;
509 }
510 [[nodiscard]]force_inline constexpr auto copy_as_negative(auto x,bool negative=1)noexcept{
511 return copy_as_negative<decltype(x)>(x,negative);
512 }
514 template<typename T> requires ::std::is_arithmetic_v<T>
515 [[nodiscard]]force_inline constexpr size_t to_size_t(T x)noexcept{
516 if constexpr(::std::is_floating_point_v<T>)
517 return (size_t)(ptrdiff_t)x;
518 else
519 return (size_t)x;
520 }
522 template<typename T> requires ::std::is_arithmetic_v<T>
523 [[nodiscard]]force_inline constexpr ::std::uintmax_t to_uintmax_t(T x)noexcept{
524 if constexpr(::std::is_floating_point_v<T>)
525 return (::std::uintmax_t)(::std::intmax_t)x;
526 else
527 return (::std::uintmax_t)x;
528 }
530 template<typename T1,typename T2> requires ::std::is_arithmetic_v<T1> and ::std::is_arithmetic_v<T2>
531 [[nodiscard]]force_inline constexpr auto mod(T1 a,T2 b){
532 if constexpr(::std::is_floating_point_v<T1>||::std::is_floating_point_v<T2>)
533 return ::std::fmod(a,b);
534 else
535 return a%b;
536 }
538 template<typename T>
539 [[nodiscard]]force_inline constexpr void set_rounding(int mode){
540 if constexpr(::std::is_floating_point_v<T>)
541 ::std::fesetround(mode);
542 }
544 template<typename T>
545 [[nodiscard]]force_inline constexpr int get_rounding(){
546 if constexpr(::std::is_floating_point_v<T>)
547 return ::std::fegetround();
548 else
549 return 0;
550 }
552 template<typename T>
555 rounding_auto_setter(int new_rounding){
556 old_rounding=get_rounding<T>();
557 set_rounding<T>(new_rounding);
558 }
560 set_rounding<T>(old_rounding);
561 }
562 };
565 template<class T> requires ::std::is_unsigned_v<T>
566 [[nodiscard]]force_inline constexpr auto rotl_nomod(const T v,const auto R)noexcept;
569 template<class T> requires ::std::is_unsigned_v<T>
570 [[nodiscard]]force_inline constexpr auto rotr_nomod(const T v,const auto r)noexcept{
571 constexpr auto d = ::std::numeric_limits<T>::digits;
572 if constexpr(::std::is_unsigned_v<decltype(r)>){
573 if(r)
574 return static_cast<T>(static_cast<T>(v >> r) | static_cast<T>(v << (d - r)));
575 else
576 return v;
577 }
578 else{
579 if(r>0)
580 return static_cast<T>(static_cast<T>(v >> r) | static_cast<T>(v << (d - r)));
581 elseif(r==0)
582 return v;
583 else//r<0
584 return rotl_nomod(v,0-r);
585 }
586 }
589 template<class T> requires ::std::is_unsigned_v<T>
590 [[nodiscard]]force_inline constexpr auto rotl_nomod(const T v,const auto r)noexcept{
591 constexpr auto d = ::std::numeric_limits<T>::digits;
592 if constexpr(::std::is_unsigned_v<decltype(r)>){
593 if(r)
594 return static_cast<T>(static_cast<T>(v << r) | static_cast<T>(v >> (d - r)));
595 else
596 return v;
597 }
598 else{
599 if(r>0)
600 return static_cast<T>(static_cast<T>(v << r) | static_cast<T>(v >> (d - r)));
601 elseif(r==0)
602 return v;
603 else//r<0
604 return rotr_nomod(v,0-r);
605 }
606 }
609 template<class T> requires ::std::is_unsigned_v<T>
610 [[nodiscard]]force_inline constexpr auto rotr(const T v,const auto R)noexcept{
611 constexpr auto d = ::std::numeric_limits<T>::digits;
612 const auto r = mod(R,d);
613 return rotr_nomod(v,r);
614 }
617 template<class T> requires ::std::is_unsigned_v<T>
618 [[nodiscard]]force_inline constexpr auto rotl(const T v,const auto R)noexcept{
619 constexpr auto d = ::std::numeric_limits<T>::digits;
620 const auto r = mod(R,d);
621 return rotl_nomod(v,r);
622 }
623 template<class T> requires ::std::is_arithmetic_v<T>
625 static constexpr auto rot_offset_npos = ::std::numeric_limits<T>::digits;//d
626 size_t _offset;
627 public:
628 force_inline constexpr rot_iterator(size_t offset)noexcept:_offset(offset%rot_offset_npos){}
630 _offset++;
631 if(_offset==rot_offset_npos)
632 _offset=0;
633 return*this;
634 }
636 if(_offset==0)
637 _offset=rot_offset_npos;
638 _offset--;
639 return*this;
640 }
641 force_inline constexpr rot_iterator operator++(int)noexcept{
642 rot_iterator tmp(*this);
643 operator++();
644 return tmp;
645 }
646 force_inline constexpr rot_iterator operator--(int)noexcept{
647 rot_iterator tmp(*this);
648 operator--();
649 return tmp;
650 }
651 [[nodiscard]]force_inline constexpr size_t value()const noexcept{
652 return _offset;
653 }
654 };
657 template<class T> requires ::std::is_unsigned_v<T>
658 [[nodiscard]]force_inline constexpr auto rotl_nomod(const T v,const rot_iterator<T>&r)noexcept{
659 return rotl_nomod(v,r.value());
660 }
663 template<class T> requires ::std::is_unsigned_v<T>
664 [[nodiscard]]force_inline constexpr auto rotr_nomod(const T v,const rot_iterator<T>&r)noexcept{
665 return rotr_nomod(v,r.value());
666 }
669 template<class T> requires ::std::is_unsigned_v<T>
670 [[nodiscard]]force_inline constexpr auto rotl(const T v,const rot_iterator<T>&r)noexcept{
671 return rotl_nomod(v,r);
672 }
675 template<class T> requires ::std::is_unsigned_v<T>
676 [[nodiscard]]force_inline constexpr auto rotr(const T v,const rot_iterator<T>&r)noexcept{
677 return rotr_nomod(v,r);
678 }
679 //abs
680 template<class T> requires ::std::is_arithmetic_v<T>
681 [[nodiscard]]force_inline constexpr auto abs(const T v)noexcept{
682 if constexpr(::std::is_signed_v<T>)
683 return v>=0?v:-v;
684 else
685 return v;
686 }
687 //feq
688 template<class T> requires ::std::is_arithmetic_v<T>
689 [[nodiscard]]force_inline constexpr bool feq(const T a,const T b)noexcept{
690 return abs(a-b)<=::std::numeric_limits<T>::epsilon();
691 }
692 //sub
693 template<class T1,class T2> requires was_not_an_ill_form(declvalue(T1)-declvalue(T2))
694 [[nodiscard]]force_inline constexpr auto sub(const T1 a,const T2 b)noexcept{
695 if constexpr(::std::is_arithmetic_v<T1>&&::std::is_arithmetic_v<T2>){
696 if constexpr(::std::is_floating_point_v<T1>||::std::is_floating_point_v<T2>)
697 return a-b;
698 else{
699 using signedT = ::std::make_signed_t<::std::common_type_t<T1,T2>>;
700 return static_cast<signedT>(a)-static_cast<signedT>(b);
701 }
702 }
703 else
704 return a-b;
705 }
706 //exp
707 //不使用std版本而是自己写的原因:std版本不是constexpr,标准会傻逼
708 template<class T> requires ::std::is_floating_point_v<T>
709 [[nodiscard]]force_inline constexpr T exp(const T v)noexcept{
710 if in_consteval{
711 typedef decltype(::std::exp(v)) RT;
712 auto exp_impl = recursive_lambda(RT x,RT sum,RT n,size_t i,RT t)noexcept -> RT{
713 const auto epsilon=sum+t/n;
714 if(feq(sum,epsilon))
715 return sum;
716 else
717 return self_recursion(x,epsilon,n*i,i+1,t*x);
718 };
719 auto exp_impl_caller = get_recursive_lambda_caller(exp_impl);
720 return exp_impl_caller(RT{v},RT{1},RT{1},2,RT{v});
721 }
722 else
723 return ::std::exp(v);
724 }
725 //log
726 //不使用std版本而是自己写的原因:std版本不是constexpr,标准会傻逼
727 template<class T> requires ::std::is_arithmetic_v<T>
728 [[nodiscard]]force_inline constexpr auto log(const T a)noexcept{
729 if in_consteval{
730 typedef decltype(::std::log(a)) RT;
731 auto log_impl = recursive_lambda(const RT x,const RT y)noexcept -> RT{
732 auto log_iter = lambda(RT x,RT y)noexcept{
733 const auto exp_y = exp(y);
734 return y + T{2}*(x-exp_y)/(x+exp_y);
735 };
736 return RT(feq(y,log_iter(x,y)) ? y : self_recursion(x,log_iter(x,y)));
737 };
738 auto log_impl_caller = get_recursive_lambda_caller(log_impl);
739 return log_impl_caller((RT)a,RT{0});
740 }
741 else
742 return ::std::log(a);
743 }
744 template<class T,class U> requires ::std::is_arithmetic_v<T> && ::std::is_arithmetic_v<U>
745 [[nodiscard]]force_inline constexpr auto log(const T a,const U b)noexcept{
746 return log(a)/log(b);
747 }
748 //pow
749 //不使用std版本而是自己写的原因:std版本不是constexpr,标准会傻逼
750 template<class T,class U> requires (::std::is_arithmetic_v<T> && ::std::is_arithmetic_v<U>)
751 [[nodiscard]]force_inline constexpr auto pow(const T a,const U b)noexcept{
752 if in_consteval{
753 typedef decltype(::std::pow(a,b)) RT;
754 return exp(RT(b)*log(RT(a)));
755 }
756 else
757 return ::std::pow(a,b);
758 }
759 //trunc
760 //不使用std版本而是自己写的原因:std版本不是constexpr,标准会傻逼
761 template<class T> requires ::std::is_floating_point_v<T>
762 [[nodiscard]]force_inline constexpr auto trunc(const T v)noexcept{
763 if in_consteval{
764 typedef decltype(::std::trunc(v)) RT;
765 return static_cast<RT>((::std::intmax_t)v);
766 }
767 else
768 return ::std::trunc(v);
769 }
770 //ceil
771 //不使用std版本而是自己写的原因:std版本不是constexpr,标准会傻逼
772 template<class T> requires ::std::is_floating_point_v<T>
773 [[nodiscard]]force_inline constexpr auto ceil(const T v)noexcept{
774 if in_consteval{
775 typedef decltype(::std::ceil(v)) RT;
776 auto ceil_impl = lambda(T x, T y)noexcept{
777 return feq(x,y) ? y : y+T{1};
778 };
779 return v<0 ? -static_cast<T>(to_uintmax_t(-v)) : ceil_impl(v,static_cast<T>(to_uintmax_t(v)));
780 }
781 else
782 return ::std::ceil(v);
783 }
784
786 template<class T> requires ::std::is_arithmetic_v<T>
787 [[nodiscard]]inline constexpr bool is_prime_num(T a)
788 {
789 if constexpr(::std::is_floating_point_v<T>)
790 if(a != ceil(a))
791 return false;
792 /*
793 应某人的要求补注释(都是主人的任务罢了.).
794 */
795 a=abs(a);
796
797 if(a<4)
798 return true;//1和0也是prime,我不管.
799 /*
800 当x≥1,那么≥5的自然数如下:
801 6x-1 6x 6x+1 6x+2 6x+3 6x+4
802 6(x+1)-1 6(x+1) 6(x+1)+1 ... //这已经是下一周期了.
803
804 考虑单个周期:
805 6x+2 6x+3 6x+4 是 2(3x+1) 3(2x+1) 2(3x+2),排除.
806 6x,排除.
807 那么,只用考虑6x±1是否是prime.
808 */
809 if(mod(mod(a,6)-1,4))
810 return false;
811 T b=static_cast<T>(::std::sqrt(a));//若一个数可以分解为两因数之积,其中一个因数必定≤其开方:反指数式减少遍历范围.
812 /*
813 接下来:
814 设要判定的数n(6x±1的缩写).
815 测试数可以看为6i-1 6i 6i+1 6i+2 6i+3 6i+4的其中之一,同样以6为周期.
816 对于测试数的整个周期,其中:
817 如果n能被6i 6i+2 6i+4整除:则n要是偶数,但±1,排除.
818 如果n能被6i+3整除:则n要是3倍数,但±1,排除.
819 综上,循环中只要考虑6i±1的情况.
820 所以以5起始,前进6(自然选择号,前进4!),逐次判断0与+2.
821 虽然很想写成以6为起始逐次判断±1的对称格式但是这样会加重时空负担.(不甘心.....)
822 */
823 for(T c=5;c<=b;c+=6)//遍历判断是否能被因数分解——不会有人看不懂吧?
824 if((!mod(a,c))||(!mod(a,(c+2))))
825 return false;
826 /*
827 最后,为什么是6?
828 就结论来说,此数值选择最常出现的两因数(除0或1外.)之积可以最大程度减少时间占用.
829 所以虽然更喜欢7/8/9之类的数不过使用6收益最大.
830 要不是这样早就写成7了.
831 */
832 return true;
833 /*
834 因为后半段判定没有考虑到≤5的数,所以本函数第一个if进行判定补全.
835 */
836 }
838 template<class T> requires ::std::is_arithmetic_v<T>
839 [[nodiscard]]inline constexpr T get_prime_num_big_or_eq_than(T a){
840 if constexpr(::std::is_floating_point_v<T>)
841 a=ceil(a);
842 while(!is_prime_num(a))
843 a++;
844 return a;
845 }
846 push_and_disable_msvc_warning(26467);//gold_of_resize永远为正数
848 [[nodiscard]]inline constexpr size_t get_next_gold_size_to_resize_for_array(size_t size){
849 /*
850 每次扩容后的空间与原空间比大致为gold of resize可以最小化时空负担.
851 */
852 return size_t(size*gold_of_resize);
853 }
855 [[nodiscard]]inline constexpr size_t get_next_gold_size_to_resize_for_hash(size_t size){
856 /*
857 素数大小的桶数可以使hash table中的每个桶尽可能活跃.
858 每次扩容后的空间与原空间比大致为gold of resize可以最小化时空负担.
859 */
860 return size_t(get_prime_num_big_or_eq_than(size*gold_of_resize));
861 }
863
865 namespace linear_interpolation{
866 [[nodiscard]]inline constexpr auto get_k(auto y1,auto y2,auto δx)noexcept{
867 auto δy=sub(y2,y1);
868 auto k=δy/δx;
869 return k;
870 }
871 [[nodiscard]]inline constexpr auto get_k(auto y1,auto y2)noexcept{
872 return get_k(y1,y2,1.0);
873 }
874 [[nodiscard]]inline constexpr auto get_result(auto y1,auto k,auto δx)noexcept{
875 auto diff=k*δx;
876 return y1+diff;
877 }
878 [[nodiscard]]inline constexpr auto get_reverse_result(auto k,auto δx,auto y)noexcept{
879 auto diff=k*δx;
880 return y-diff;
881 }
882 }
883 }
887 using magic_number::mod;
891 using magic_number::rotl;
892 using magic_number::rotr;
896 using magic_number::abs;
897 using magic_number::exp;
898 using magic_number::log;
899 using magic_number::pow;
900 using magic_number::ceil;
904
905 //file_end
906
907 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
908
909 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/other.hpp"
910 //other.hpp
911 //at namespace elc::defs::base
912 /*
913 未完成的elc解释器base_defs文件
914 由steve02081504与Alex0125设计、编写
915 转载时请在不对此文件做任何修改的同时注明出处
916 项目地址:https://github.com/steve02081504/ELC
917 */
918 class empty_type{};
919
920 template<typename T,typename U>
921 inline auto&assign(T&&a,U&&b)noexcept_as(a=b){//为绕过条件内赋值时の警告而使用
922 a=b;
923 return a;
924 }
925
926 template<typename T>
927 inline void discard(T&&){}//fucking nodiscard.
928 template<typename T>
929 inline void just_a_use(T&&){}
930
931 template<typename T>
933
935 template<typename T>
936 static void destroy(T*a)noexcept{
937 if constexpr(was_not_an_ill_form(the_destroy(a)))
938 the_destroy(a);
939 else
940 template_error("Please overload the function the_destroy in the namespace where this type is defined.");
941 }
942
943 //file_end
944
945 #line 15 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
946
947 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/cast.hpp"
948 //cast.hpp
949 //at namespace elc::defs::base
950 /*
951 未完成的elc解释器base_defs文件
952 由steve02081504与Alex0125设计、编写
953 转载时请在不对此文件做任何修改的同时注明出处
954 项目地址:https://github.com/steve02081504/ELC
955 */
957 26491//down_cast警告diss
958 26466//down_cast警告diss
959 26492//const_cast警告diss
960 );
961 //对值追加const
962 template<typename T>
963 inline constexpr const T add_const(T a)noexcept{return a;}
964 //对引用追加const
965 template<typename T>
966 inline constexpr const T&add_const(T&a)noexcept{return a;}
967 //对引用移除const
968 template<typename T>
969 inline constexpr T&remove_const(const T&a)noexcept{return const_cast<T&>(a);}
970 //对指针追加const
971 template<typename T>
972 inline constexpr const T*add_const(T*a)noexcept{return a;}
973 //对指针移除const
974 template<typename T>
975 inline constexpr T*remove_const(const T*a)noexcept{return ::std::launder(const_cast<T*>(a));}
976 //向下转型至
977 template<typename T,typename U>
978 inline constexpr T down_cast(U a)noexcept{return static_cast<T>(a);}
980
981 //file_end
982
983 #line 17 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
984 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/special_flags.hpp"
985 //special_flag.hpp
986 //at namespace elc::defs::base
987 /*
988 未完成的elc解释器base_defs文件
989 由steve02081504与Alex0125设计、编写
990 转载时请在不对此文件做任何修改的同时注明出处
991 项目地址:https://github.com/steve02081504/ELC
992 */
993
994 #define defspecflag(name)\
995 constexpr struct name##_t{} name{}
996
999
1000 #undef defspecflag
1001
1002 //file_end
1003
1004 #line 18 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
1005 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/non_Xable.hpp"
1006 //non_Xable.hpp
1007 //at namespace elc::defs::base
1008 /*
1009 未完成的elc解释器base_defs文件
1010 由steve02081504与Alex0125设计、编写
1011 转载时请在不对此文件做任何修改的同时注明出处
1012 项目地址:https://github.com/steve02081504/ELC
1013 */
1015 constexpr non_copy_assign_able()noexcept=default;
1016 constexpr non_copy_assign_able(const non_copy_assign_able&)noexcept=default;
1017 constexpr non_copy_assign_able(non_copy_assign_able&&)noexcept=default;
1018 constexpr non_copy_assign_able& operator=(const non_copy_assign_able&)&noexcept=delete;
1019 constexpr non_copy_assign_able& operator=(non_copy_assign_able&&)&noexcept=default;
1020 };
1022 constexpr non_move_assign_able()noexcept=default;
1023 constexpr non_move_assign_able(const non_move_assign_able&)noexcept=default;
1024 constexpr non_move_assign_able(non_move_assign_able&&)noexcept=default;
1025 constexpr non_move_assign_able& operator=(const non_move_assign_able&)&noexcept=default;
1026 constexpr non_move_assign_able& operator=(non_move_assign_able&&)&noexcept=delete;
1027 };
1028
1030
1032 constexpr non_copy_construct_able()=default;
1035 };
1037 constexpr non_move_construct_able()=default;
1040 };
1041
1043 constexpr non_default_construct_able()=delete;
1044 };
1045
1048
1049 //file_end
1050
1051 #line 19 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
1052 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/attribute.hpp"
1053 //attribute.hpp
1054 //at namespace elc::defs::base
1055 /*
1056 未完成的elc解释器base_defs文件
1057 由steve02081504与Alex0125设计、编写
1058 转载时请在不对此文件做任何修改的同时注明出处
1059 项目地址:https://github.com/steve02081504/ELC
1060 */
1061 template<class T,typename attribute_name>
1063 protected:
1064 template<class U,special_attribute_t another_attribute_name>
1066 constexpr T*get_handle()noexcept{return down_cast<T*>(down_cast<attribute_name*>(this));}
1067
1068 template<class U,special_attribute_t another_attribute_name>
1069 friend const U*get_handle(const attribute<U,another_attribute_name>*)noexcept;
1070 constexpr const T*get_handle()const noexcept{return down_cast<const T*>(down_cast<const attribute_name*>(this));}
1071 };
1072 template<class T,special_attribute_t attribute_name>
1073 T*get_handle(attribute<T,attribute_name>*a)noexcept{return a->get_handle();}
1074 template<class T,special_attribute_t attribute_name>
1075 const T*get_handle(const attribute<T,attribute_name>*a)noexcept{return a->get_handle();}
1076
1077 template<class T,common_attribute_t attribute_name>
1078 T* get_handle(attribute<T,attribute_name<T>>*a)noexcept{return get_handle<T,attribute_name<T>>(a);}
1079 template<class T,common_attribute_t attribute_name>
1080 const T* get_handle(const attribute<T,attribute_name<T>>*a)noexcept{return get_handle<T,attribute_name<T>>(a);}
1081
1082 template<special_attribute_t attribute_name,class T>
1083 auto attribute_ptr_cast(T*ptr)noexcept{
1084 return static_cast<attribute_name*>(ptr);
1085 }
1086 template<special_attribute_t attribute_name,class T>
1087 auto attribute_ptr_cast(const T* ptr)noexcept{
1088 return static_cast<const attribute_name*>(ptr);
1089 }
1090 template<common_attribute_t attribute_name,class T>
1091 auto attribute_ptr_cast(T*ptr)noexcept{
1092 return attribute_ptr_cast<attribute_name<remove_cvref<T>>>(ptr);
1093 }
1094
1095 template<special_attribute_t attribute_name,class T>
1096 auto& attribute_cast(T&t)noexcept{
1097 return*attribute_ptr_cast<attribute_name>(&t);
1098 }
1099 template<common_attribute_t attribute_name,class T>
1100 auto& attribute_cast(T&t)noexcept{
1101 return*attribute_ptr_cast<attribute_name>(&t);
1102 }
1103
1104 template<special_attribute_t... attribute_names>
1105 struct special_attribute_pack:virtual attribute_names...{
1106 /*兼容用*/
1107 template<class T>
1108 struct on_type:special_attribute_pack<attribute_names>...{};
1109 };
1110 template<common_attribute_t... attribute_names>
1112 template<class T>
1113 struct on_type:attribute_names<T>...{};
1114 };
1115
1116 //file_end
1117
1118 #line 20 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
1119 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/special_attribute.hpp"
1120 //special_attribute.hpp
1121 //at namespace elc::defs::base
1122 /*
1123 未完成的elc解释器base_defs文件
1124 由steve02081504与Alex0125设计、编写
1125 转载时请在不对此文件做任何修改的同时注明出处
1126 项目地址:https://github.com/steve02081504/ELC
1127 */
1130
1131 //file_end
1132
1133 #line 21 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
1134 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/type_info.hpp"
1135 //type_info.hpp
1136 //at namespace elc::defs::base
1137 /*
1138 未完成的elc解释器base_defs文件
1139 由steve02081504与Alex0125设计、编写
1140 转载时请在不对此文件做任何修改的同时注明出处
1141 项目地址:https://github.com/steve02081504/ELC
1142 */
1143 struct type_name_t;
1145 private:
1146 struct type_id_t{
1147 const ::std::type_info* _m;
1148
1149 constexpr type_id_t(const ::std::type_info&a)noexcept:_m(&a){}
1150 constexpr type_id_t(const type_id_t&a)noexcept=default;
1151 [[nodiscard]]type_name_t get_name()const noexcept;//定义于type_name.hpp
1152 [[nodiscard]]size_t get_hash()const noexcept{
1153 return _m->hash_code();
1154 }
1155 [[nodiscard]]bool operator==(const type_id_t&a)const noexcept{return *_m==*a._m;}
1156 };
1157
1158 type_id_t _tid;
1159 public:
1160 constexpr base_type_info_t(const ::std::type_info&a)noexcept:_tid(a){}
1161 constexpr base_type_info_t(const base_type_info_t&)noexcept=default;
1162 [[nodiscard]]type_name_t get_name()const noexcept;//定义于type_name.hpp
1163 [[nodiscard]]size_t get_hash()const noexcept{
1164 return _tid.get_hash();
1165 }
1166 [[nodiscard]]bool operator==(const base_type_info_t&a)const noexcept{return _tid==a._tid;}
1167 [[nodiscard]]bool operator==(const ::std::type_info&a)const noexcept{return _tid==type_id_t(a);}
1168 };
1169 template<class T>
1171 typedef T type;
1172
1173 template<class U>
1174 static constexpr bool same_as=::std::is_same_v<T,U>;
1175 template<class U>
1176 static constexpr bool not_same_as=!same_as<U>;
1177 template<class U>
1178 static constexpr bool base_on=::std::is_convertible_v<remove_cvref<T>*,remove_cvref<U>*>;
1179 template<class U>
1180 static constexpr bool not_base_on=!base_on<U>;
1181
1182 template<class U>
1183 static constexpr bool can_convert_to=::std::is_convertible_v<T,U>;
1184 template<class U>
1185 static constexpr bool can_t_convert_to=!can_convert_to<U>;
1186 template<class U>
1187 static constexpr bool can_nothrow_convert_to=::std::is_nothrow_convertible_v<T,U>;
1188 template<class U>
1189 static constexpr bool can_t_nothrow_convert_to=!can_nothrow_convert_to<U>;
1190
1191 /*
1192 //没有重载变量模板一说
1193 template<typename attribute_name>
1194 static constexpr bool has_attribute=has_attribute_helper<attribute_name>();
1195 template<typename attribute_name>
1196 static constexpr bool not_has_attribute=!has_attribute(attribute_name);
1197 */
1198 template<special_attribute_t attribute_name>
1199 static constexpr bool has_attribute_helper(){
1200 return base_on<attribute_name>;
1201 }
1202 template<common_attribute_t attribute_name>
1203 static constexpr bool has_attribute_helper(){
1204 return has_attribute_helper<attribute_name<remove_cvref<T>>>();
1205 }
1206 template<special_attribute_t attribute_name>
1207 static constexpr bool not_has_has_attribute_helper(){
1208 return!has_attribute_helper<attribute_name>();
1209 }
1210 template<common_attribute_t attribute_name>
1211 static constexpr bool not_has_has_attribute_helper(){
1212 return!has_attribute_helper<attribute_name>();
1213 }
1214
1215 // defed at defs.
1216 // #define has_attribute(...) has_attribute_helper<__VA_ARGS__>()
1217 // #define not_has_attribute(...) not_has_has_attribute_helper<__VA_ARGS__>()
1218
1219 template<common_attribute_t... common_attribute_names>
1220 struct with_common_attribute:common_attribute_pack<common_attribute_names...>::template_name on_type<T>{
1221 template<special_attribute_t... special_attribute_names>
1223 common_attribute_pack<common_attribute_names...>::template_name on_type<T>,
1224 special_attribute_pack<special_attribute_names...>::template_name on_type<T>
1225 {};
1226 };
1227 template<special_attribute_t... special_attribute_names>
1228 struct with_special_attribute:special_attribute_pack<special_attribute_names...>::template_name on_type<T>{
1229 template<common_attribute_t... common_attribute_names>
1231 special_attribute_pack<special_attribute_names...>::template_name on_type<T>,
1232 common_attribute_pack<common_attribute_names...>::template_name on_type<T>
1233 {};
1234 };
1235
1236 constexpr type_info_t()noexcept{}
1237 constexpr type_info_t(const type_info_t&)noexcept=default;
1238 [[nodiscard]]constexpr operator base_type_info_t()const noexcept{return base_type_info_t(typeid(T));}
1239 [[nodiscard]]constexpr bool operator==(const ::std::type_info&a)const noexcept{return base_type_info_t(*this)==base_type_info_t(a);}
1240 [[nodiscard]]type_name_t get_name()const noexcept;//定义于type_name.hpp
1241 [[nodiscard]]size_t get_hash()const noexcept{
1242 return base_type_info_t(*this).get_hash();
1243 }
1244 };
1245
1246 template<class T>
1248
1249 template<class T>
1250 [[nodiscard]]constexpr bool operator==(const type_info_t<T>&,const type_info_t<T>&){return true;}
1251 template<class T,class U>
1252 [[nodiscard]]constexpr bool operator==(const type_info_t<T>&,const type_info_t<U>&){return false;}
1253
1254 /*
1255 template<class T,class U>
1256 consteval auto operator?:(auto a,const type_info_t<T>&b,const type_info_t<U>&c){
1257 if(a)
1258 return b;
1259 else
1260 if(!a)
1261 return c;
1262 else
1263 return b && c;
1264 else
1265 return void();
1266 }
1267 */
1268
1269 //file_end
1270
1271 #line 22 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
1272 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/min_max.hpp"
1273 //min_max.hpp
1274 //at namespace elc::defs::base
1275 /*
1276 未完成的elc解释器base_defs文件
1277 由steve02081504与Alex0125设计、编写
1278 转载时请在不对此文件做任何修改的同时注明出处
1279 项目地址:https://github.com/steve02081504/ELC
1280 */
1281 #undef min
1282 #undef max
1291 constexpr struct min_t{
1292 template<class...Args>
1293 static constexpr bool able=was_not_an_ill_form(::std::min(declvalue(Args)...));
1294
1295 template<typename T>
1296 static constexpr bool get_limit_able=was_not_an_ill_form(::std::numeric_limits<T>::min());
1297
1298 template<class...Args> requires able<Args...>
1299 [[nodiscard]]constexpr auto operator()(Args&&...rest)const{
1300 return ::std::min(forward<Args>(rest)...);
1301 }
1302 template<class T> requires able<::std::initializer_list<T>>
1303 [[nodiscard]]constexpr auto operator()(::std::initializer_list<T>l)const{
1304 return ::std::min(l);
1305 }
1306 template<typename T> requires get_limit_able<T>
1307 [[nodiscard]]constexpr auto operator()(type_info_t<T>)const{
1308 return ::std::numeric_limits<T>::min();
1309 }
1319 constexpr struct max_t{
1320 template<class...Args>
1321 static constexpr bool able=was_not_an_ill_form(::std::max(declvalue(Args)...));
1322
1323 template<typename T>
1324 static constexpr bool get_limit_able=was_not_an_ill_form(::std::numeric_limits<T>::max());
1325
1326 template<class...Args> requires able<Args...>
1327 [[nodiscard]]constexpr auto operator()(Args&&...rest)const{
1328 return ::std::max(forward<Args>(rest)...);
1329 }
1330 template<class T> requires able<::std::initializer_list<T>>
1331 [[nodiscard]]constexpr auto operator()(::std::initializer_list<T>l)const{
1332 return ::std::max(l);
1333 }
1334 template<typename T> requires get_limit_able<T>
1335 [[nodiscard]]constexpr auto operator()(type_info_t<T>)const{
1336 return ::std::numeric_limits<T>::max();
1337 }
1339
1340 //file_end
1341
1342 #line 23 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
1343 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/null_ptr.hpp"
1344 //null_ptr.hpp
1345 //at namespace elc::defs::base
1346 /*
1347 未完成的elc解释器base_defs文件
1348 由steve02081504与Alex0125设计、编写
1349 转载时请在不对此文件做任何修改的同时注明出处
1350 项目地址:https://github.com/steve02081504/ELC
1351 */
1352 namespace null_ptr_n{
1357
1364
1365 enable_adl(the_get_null_ptr);
1366 template<typename T>
1367 [[nodiscard]]constexpr auto get_null_ptr()noexcept{
1368 suppress_msvc_warning(26462)//貌似msvc在这里有bug
1369 constexpr auto null_as_T = static_cast<T*>(nullptr);
1370 if constexpr(was_not_an_ill_form(the_get_null_ptr(null_as_T)))
1371 return the_get_null_ptr(null_as_T);
1372 elseif constexpr(type_info<T>.has_attribute(can_t_use_default_null_ptr)&&type_info<T>.not_has_attribute(force_use_default_null_ptr)){
1373 template_error("please overload the function the_get_null_ptr in the namespace where this type is defined.");
1374 return null_as_T;
1375 }
1376 else
1377 return null_as_T;
1378 }
1379
1380
1384 constexpr struct null_ptr_t{
1385 template<typename T>
1386 [[nodiscard]]constexpr_as(get_null_ptr<remove_cvref<T>>())auto base_get()const noexcept{return get_null_ptr<remove_cvref<T>>();}
1387 template<typename T>
1388 [[nodiscard]]constexpr_as(base_get<T>())operator T*()const noexcept{return down_cast<T*>(base_get<T>());}
1389 //constexpr operator decltype(nullptr)()const noexcept{return nullptr;}//提醒接口设计者注意null_ptr的重载版本.
1390 }null_ptr{};
1391
1392 template<typename T,typename U=decltype(*null_ptr.base_get<T>())>
1393 [[nodiscard]]auto operator==(T*a,null_ptr_t)noexcept{
1394 return null_ptr.base_get<T>()==static_cast<const remove_ref<U>*>(add_const(a));
1395 }
1396 }
1400 typedef decltype(null_ptr) null_ptr_t;
1401 typedef decltype(nullptr) nullptr_t;
1402
1403 //file_end
1404
1405 #line 24 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
1406 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/compare.hpp"
1407 //compare.hpp
1408 //at namespace elc::defs::base
1409 /*
1410 未完成的elc解释器base_defs文件
1411 由steve02081504与Alex0125设计、编写
1412 转载时请在不对此文件做任何修改的同时注明出处
1413 项目地址:https://github.com/steve02081504/ELC
1414 */
1415 //end_by_zero_t
1416 /*
1417 用于标志某一数据串以0结尾
1418 */
1419 inline constexpr struct end_by_zero_t{}end_by_zero;
1420 //just_an_part_t
1421 /*
1422 用于标志某一数据串并没有完结
1423 */
1424 inline constexpr struct just_an_part_t{}just_an_part;
1425 //equal:值相等.
1426 /*
1427 相等比较任意支持比较的类型或其数组——简易封装.
1428 用法:
1429 判断两值是否可比较。
1430 equal.able<类型1,类型2(可选,默认为类型1)> -> bool
1431 判断将两者进行比较时是否会抛出异常。
1432 equal.nothrow<类型,类型2(可选,默认为类型1)> -> bool
1433
1434 equal(T1,T2) -> auto
1435
1436 equal(T1[N1],T2[N2]) -> bool
1437 equal(T1*,size1,T2*,size2) -> bool
1438 equal(T1*,T2*,size) -> bool
1439 equal(T1*,size1,T2*,end_by_zero) -> bool
1440 equal(T1*,end_by_zero,T2*,size) -> bool
1441 equal(T1*,end_by_zero,T2*,end_by_zero) -> bool
1442 */
1443 constexpr struct equal_t{
1444 template<class T,class U=T>
1445 static constexpr bool able= was_not_an_ill_form(declvalue(T)==declvalue(U));
1446 template<class T,class U=T>
1447 static constexpr bool nothrow= was_not_an_ill_form_and_noexcept(declvalue(T)==declvalue(U));
1448
1449 template<typename T,typename U>
1450 [[nodiscard]]constexpr auto operator()(T&&a,U&&b)const noexcept(nothrow<T,U>){
1451 return a==b;
1452 }
1453 template<typename T,typename U>
1454 [[nodiscard]]constexpr bool operator()(T*a,U*b,size_t size)const noexcept(nothrow<T,U>){
1455 while(size--){
1456 if(*(a++)!=*(b++))
1457 return false;
1458 }
1459 return true;
1460 }
1461 template<typename T,typename U,size_t N1,size_t N2>
1462 [[nodiscard]]constexpr bool operator()(T(&a)[N1],U(&b)[N2])const noexcept(nothrow<T,U>){
1463 if constexpr(N1==N2)
1464 return operator()(a,b,N1);
1465 else{
1466 template_warning("N1!=N2");
1467 return false;
1468 }
1469 }
1470 template<typename T,typename U>
1471 [[nodiscard]]constexpr bool operator()(T*a,size_t size1,U*b,size_t size2)const noexcept(nothrow<T,U>){
1472 if(size1==size2)
1473 return operator()(a,b,size1);
1474 else
1475 return false;
1476 }
1477 template<typename T,typename U>
1478 [[nodiscard]]constexpr bool operator()(T*a,size_t size1,U*b,end_by_zero_t)const noexcept(nothrow<T,U>){
1479 while(size1--){
1480 if(*a!=*b || *b==U{0})
1481 return false;
1482 a++;
1483 b++;
1484 }
1485 return *b==U{0};
1486 }
1487 template<typename T,typename U>
1488 [[nodiscard]]constexpr bool operator()(T*a,end_by_zero_t,U*b,size_t size2)const noexcept(nothrow<T,U>){
1489 return operator()(b,size2,a,end_by_zero);
1490 }
1491 template<typename T,typename U>
1492 [[nodiscard]]constexpr bool operator()(T*a,end_by_zero_t,U*b,end_by_zero_t)const noexcept(nothrow<T,U>){
1493 floop{
1494 if(*a!=*b)
1495 return false;
1496 if(*a==T{0})
1497 return true;
1498 a++;
1499 b++;
1500 }
1501 }
1502 template<typename T,typename U>
1503 [[nodiscard]]constexpr bool operator()(T*a,size_t size1,just_an_part_t,U*b,end_by_zero_t)const noexcept(nothrow<T,U>){
1504 while(size1--){
1505 if(*a!=*b || *b==U{0})
1506 return false;
1507 a++;
1508 b++;
1509 }
1510 return true;
1511 }
1513
1514 //eq:同一对象
1515 template<typename T>
1516 [[nodiscard]]constexpr auto is_eq(T&&a,T&&b)noexcept_as(&a==&b){
1517 return &a==&b;
1518 }
1519 template<typename T>
1520 [[nodiscard]]constexpr auto is_not_eq(T&&a,T&&b)noexcept_as(!is_eq(a,b)){
1521 return!is_eq(a,b);
1522 }
1523
1524 //compare:三路比较
1525 /*
1526 若大小相同则以字典序三路比较任意支持比较的类型或其数组,并在 <=> 不可用时以 < 和 == 为后备.
1527 用法:
1528 判断两者是否可真的进行三路比较。
1529 compare.r_able<类型1,类型2(可选,默认与1相同)> -> bool
1530 判断两者是否可进行compare操作。
1531 compare.able<类型1,类型2(可选,默认与1相同)> -> bool
1532 判断将两者进行三路比较是否会抛出异常。
1533 compare.nothrow<类型1,类型2(可选,默认与1相同)> -> bool
1534
1535 compare(T1,T2)
1536 compare(T1[N1],T2[N2])
1537 compare(T1*,size1,T2*,size2)
1538 compare(T1*,T2*,size)
1539 返回类型语义上是三路比较的结果类型,具体类型视情况而定.
1540
1541 以字典序进行三路比较。
1542 compare.lexicographical(T1,T2)
1543 compare.lexicographical(T1[N1],T2[N2])
1544 compare.lexicographical(T1*,size1,T2*,size2)
1545 compare.lexicographical(T1*,T2*,size)
1546 返回类型语义上是三路比较的结果类型,具体类型视情况而定.
1547
1548 翻转三路比较的结果类型。
1549 compare.reverse(order)
1550 返回对应结果类型的反义,与零相等或无法比较时则返回其本身。
1551 */
1552 constexpr struct compare_t{
1553 template<class T,class U=T>
1554 static constexpr bool r_able= was_not_an_ill_form(declvalue(T)<=>declvalue(U));
1555
1556 template<class T,class U=T>
1557 static constexpr bool able= r_able<T,U> ||
1559 declvalue(T)==declvalue(U),
1560 declvalue(T)<declvalue(U),
1561 declvalue(U)<declvalue(T)
1562 );
1563 template<class T,class U=T>
1564 static constexpr bool nothrow= was_not_an_ill_form_and_noexcept(declvalue(T)<=>declvalue(U)) ||
1566 declvalue(T)==declvalue(U),
1567 declvalue(T)<declvalue(U),
1568 declvalue(U)<declvalue(T)
1569 );
1570
1571
1572 template<class T,class U>
1573 [[nodiscard]]static constexpr auto base_call(T&&a,U&&b)noexcept(nothrow<T,U>){
1574 //在 <=> 不可用时以 < 和 == 为后备,优于直接 <=>
1575 if constexpr(r_able<T,U>)
1576 return a<=>b;
1577 else return a == b ? partial_ordering::equivalent :
1578 a < b ? partial_ordering::less :
1579 b < a ? partial_ordering::greater :
1580 partial_ordering::unordered ;
1581 }
1582
1583 template<class T,class U=T>
1584 using type=decltype(base_call(declvalue(T),declvalue(U)));
1585
1586 template<typename T,typename U>
1587 [[nodiscard]]constexpr auto operator()(T&&a,U&&b)const noexcept(nothrow<T,U>){
1588 return base_call(a,b);
1589 }
1590 template<typename T,typename U>
1591 [[nodiscard]]constexpr auto operator()(T*a,U*b,size_t size)const noexcept(nothrow<T,U>){
1592 while(size--){
1593 if(auto tmp=base_call(*(a++),*(b++)); tmp!=0)
1594 return tmp;
1595 }
1596 return strong_ordering::equivalent;
1597 }
1598 template<typename T,typename U,size_t N1,size_t N2>
1599 [[nodiscard]]constexpr auto operator()(T(&a)[N1],U(&b)[N2])const noexcept(nothrow<T,U>){
1600 if constexpr(N1==N2)
1601 return operator()(a,b,N1);
1602 else{
1603 template_warning("N1!=N2");
1604 return N1<=>N2;
1605 }
1606 }
1607 template<typename T,typename U>
1608 [[nodiscard]]constexpr auto operator()(T*a,size_t size1,U*b,size_t size2)const noexcept(nothrow<T,U>){
1609 type<T,U> tmp=size1<=>size2;
1610 if(tmp!=0)
1611 return tmp;
1612 else
1613 return operator()(a,b,size1);
1614 }
1615 template<typename T,typename U>
1616 [[nodiscard]]constexpr auto operator()(T*a,size_t size1,U*b,end_by_zero_t)const noexcept(nothrow<T,U>){
1617 type<T,U> tmp=strong_ordering::equivalent;
1618 while(size1--){
1619 if(*b==U{0})
1620 return strong_ordering::greater;
1621 if(tmp==0)
1622 tmp=base_call(*a,*b);
1623 a++;
1624 b++;
1625 }
1626 return *b==U{0}?tmp:strong_ordering::less;
1627 }
1628 template<typename T,typename U>
1629 [[nodiscard]]constexpr auto operator()(T*a,end_by_zero_t,U*b,size_t size2)const noexcept(nothrow<T,U>){
1630 type<T,U> tmp=strong_ordering::equivalent;
1631 while(size2--){
1632 if(*a==T{0})
1633 return strong_ordering::less;
1634 if(tmp==0)
1635 tmp=base_call(*a,*b);
1636 a++;
1637 b++;
1638 }
1639 return *b==U{0}?tmp:strong_ordering::less;
1640 }
1641 template<typename T,typename U>
1642 [[nodiscard]]constexpr auto operator()(T*a,end_by_zero_t,U*b,end_by_zero_t)const noexcept(nothrow<T,U>){
1643 type<T,U> tmp=strong_ordering::equivalent;
1644 floop{
1645 if(*a==T{0})
1646 return *b==U{0}?tmp:strong_ordering::less;
1647 if(tmp==0)
1648 tmp=base_call(*a,*b);
1649 a++;
1650 b++;
1651 }
1652 }
1653 template<typename T,typename U>
1654 [[nodiscard]]constexpr auto operator()(T*a,size_t size1,just_an_part_t,U*b,end_by_zero_t)const noexcept(nothrow<T,U>){
1655 type<T,U> tmp=strong_ordering::equivalent;
1656 while(size1--){
1657 if(*b==U{0})
1658 return strong_ordering::greater;
1659 if(tmp==0)
1660 tmp=base_call(*a,*b);
1661 a++;
1662 b++;
1663 }
1664 return tmp;
1665 }
1666 template<typename T,typename U>
1667 [[nodiscard]]constexpr auto lexicographical(T*a,size_t size1,U*b,size_t size2)const noexcept(nothrow<T,U>){
1668 if(auto tmp=operator()(a,b,min(size1,size2)); tmp!=0)
1669 return tmp;
1670 else
1671 return size1<=>size2;
1672 }
1673 template<typename T,typename U,size_t N1,size_t N2>
1674 [[nodiscard]]constexpr auto lexicographical(T(&a)[N1],U(&b)[N2])const noexcept(nothrow<T,U>){
1675 return lexicographical(a,N1,b,N2);
1676 }
1677 template<typename T,typename U>
1678 [[nodiscard]]constexpr auto lexicographical(T*a,size_t size1,U*b,end_by_zero_t)const noexcept(nothrow<T,U>){
1679 while(size1--){
1680 if(*b==U{0})
1681 return strong_ordering::greater;
1682 if(auto tmp=base_call(*a,*b); tmp!=0)
1683 return tmp;
1684 a++;
1685 b++;
1686 }
1687 return *b==U{0}?strong_ordering::equivalent:
1688 strong_ordering::less;
1689 }
1690 template<typename T,typename U>
1691 [[nodiscard]]constexpr auto lexicographical(T*a,end_by_zero_t,U*b,size_t size2)const noexcept(nothrow<T,U>){
1692 while(size2--){
1693 if(*a==T{0})
1694 return strong_ordering::less;
1695 if(auto tmp=base_call(*a,*b); tmp!=0)
1696 return tmp;
1697 a++;
1698 b++;
1699 }
1700 return *b==U{0}?strong_ordering::equivalent:
1701 strong_ordering::less;
1702 }
1703 template<typename T,typename U>
1704 [[nodiscard]]constexpr auto lexicographical(T*a,end_by_zero_t,U*b,end_by_zero_t)const noexcept(nothrow<T,U>){
1705 floop{
1706 if(*a==T{0})
1707 return *b==U{0}?strong_ordering::equivalent:
1708 strong_ordering::less;
1709 if(auto tmp=base_call(*a,*b); tmp!=0)
1710 return tmp;
1711 a++;
1712 b++;
1713 }
1714 }
1715 template<typename T,typename U>
1716 [[nodiscard]]constexpr auto lexicographical(T*a,size_t size1,just_an_part_t,U*b,end_by_zero_t)const noexcept(nothrow<T,U>){
1717 while(size1--){
1718 if(*b==U{0})
1719 return strong_ordering::greater;
1720 if(auto tmp=base_call(*a,*b); tmp!=0)
1721 return tmp;
1722 a++;
1723 b++;
1724 }
1725 return strong_ordering::equivalent;
1726 }
1727 //
1728 [[nodiscard]]constexpr auto reverse(partial_ordering odr)const noexcept{
1729 if(odr==partial_ordering::greater)
1730 return partial_ordering::less;
1731 elseif(odr==partial_ordering::less)
1732 return partial_ordering::greater;
1733 else
1734 return odr;
1735 }
1736 [[nodiscard]]constexpr auto reverse(weak_ordering odr)const noexcept{
1737 if(odr==weak_ordering::greater)
1738 return weak_ordering::less;
1739 elseif(odr==weak_ordering::less)
1740 return weak_ordering::greater;
1741 else
1742 return odr;
1743 }
1744 [[nodiscard]]constexpr auto reverse(strong_ordering odr)const noexcept{
1745 if(odr==strong_ordering::greater)
1746 return strong_ordering::less;
1747 elseif(odr==strong_ordering::less)
1748 return strong_ordering::greater;
1749 else
1750 return odr;
1751 }
1753
1754 //file_end
1755
1756 #line 25 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
1757 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/note.hpp"
1758 //note.hpp
1759 //at namespace elc::defs::base
1760 /*
1761 未完成的elc解释器base_defs文件
1762 由steve02081504与Alex0125设计、编写
1763 转载时请在不对此文件做任何修改的同时注明出处
1764 项目地址:https://github.com/steve02081504/ELC
1765 */
1766 namespace note_n{
1767 #define def_note(name)\
1768 template<typename T>\
1769 struct name##_t{\
1770 T value;\
1771 force_inline constexpr name##_t(T a):value(a){}\
1772 template<class U>\
1773 force_inline constexpr name##_t(name##_t<U>a):value(a.value){}\
1774 force_inline constexpr operator T(){return value;}\
1775 force_inline constexpr T operator()(){return value;}\
1776 };\
1777 template<typename T>\
1778 constexpr name##_t<T>name(T v){return{v};}
1779
1783
1784 #undef def_note
1785 constexpr struct fail_t{}fail{};
1786 }
1787 namespace note=note_n;
1788
1789 //file_end
1790
1791 #line 26 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
1792 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/array_like.hpp"
1793 //array_like.hpp
1794 //at namespace elc::defs::base
1795 /*
1796 未完成的elc解释器base_defs文件
1797 由steve02081504与Alex0125设计、编写
1798 转载时请在不对此文件做任何修改的同时注明出处
1799 项目地址:https://github.com/steve02081504/ELC
1800 */
1801 namespace array_like_n{
1802 template<class T>
1803 [[nodiscard]]inline constexpr size_t size_of_array_like(T&&)noexcept{return 1;}
1804 template<class T,size_t N>
1805 [[nodiscard]]inline constexpr size_t size_of_array_like(T(&)[N])noexcept{return N;}
1806 template<class T>
1807 [[nodiscard]]inline size_t size_of_array_like(::std::initializer_list<T>&a)noexcept{return a.size();}
1808
1809 template<class T>
1810 [[nodiscard]]inline constexpr auto begin_of_array_like(T&&a)noexcept{return addressof(a);}
1811 template<class T,size_t N>
1812 [[nodiscard]]inline constexpr auto begin_of_array_like(T(&a)[N])noexcept{return addressof(a[0]);}
1813 template<class T>
1814 [[nodiscard]]inline const T* begin_of_array_like(::std::initializer_list<T>&a)noexcept{return a.begin();}
1815
1816 template<class T>
1817 [[nodiscard]]inline auto end_of_array_like(T&&a)noexcept{return begin_of_array_like(a)+size_of_array_like(a);}
1818
1819 template<class T>
1821 (T v){
1824 }
1825 );
1826
1827 template<class T>
1829 template<class T>
1830 constexpr bool is_not_signal_value_for_array_like=!is_signal_value_for_array_like<T>;
1831
1832 template<class T,class U>
1834 (U v){
1835 begin_of_array_like<T>(v);
1836 size_of_array_like<T>(v);
1837 }
1838 );
1839
1840 template<class T>
1842 typedef T* iterator;
1843 typedef const T* const_iterator;
1845 private:
1846 T*_begin=nullptr;
1847 size_t _size=0;
1848 public:
1849 constexpr explicit array_like_view_t(T*a,size_t b)noexcept:_begin(a),_size(b){}
1850 template<class U> requires is_array_like_for<T,U>
1851 explicit constexpr_as_auto array_like_view_t(U&&a)noexcept_as(begin_of_array_like<T>(a),size_of_array_like<T>(a)):array_like_view_t(begin_of_array_like<T>(a),size_of_array_like<T>(a)){}
1852 constexpr array_like_view_t(const this_t&)noexcept=default;
1853
1854 void swap_with(this_t&b)noexcept_as(swap(_begin,b._begin),swap(_size,b._size)){
1855 swap(_begin,b._begin);
1856 swap(_size,b._size);
1857 }
1858
1859 [[nodiscard]]constexpr const_iterator c_str()const noexcept{return _begin;}
1860 [[nodiscard]]constexpr size_t size()const noexcept{return _size;}
1861
1862 [[nodiscard]]constexpr iterator begin()noexcept requires(type_info<iterator>!=type_info<const_iterator>){return _begin;}
1863 [[nodiscard]]constexpr iterator end()noexcept requires(type_info<iterator>!=type_info<const_iterator>){return begin()+size();}
1864 [[nodiscard]]constexpr const_iterator begin()const noexcept{return _begin;}
1865 [[nodiscard]]constexpr const_iterator end()const noexcept{return begin()+size();}
1866
1867 [[nodiscard]]constexpr const_iterator cbegin()const noexcept{return remove_const(this)->begin();}
1868 [[nodiscard]]constexpr const_iterator cend()const noexcept{return remove_const(this)->end();}
1869
1870 [[nodiscard]]constexpr bool empty()const noexcept{return size();}
1871
1872 [[nodiscard]]constexpr T&operator[](size_t pos)noexcept{return begin()[pos];}
1873 [[nodiscard]]constexpr const T&operator[](size_t pos)const noexcept{return remove_const(*this)[pos];}
1874
1875 [[nodiscard]]constexpr auto operator<=>(this_t a)noexcept(compare.nothrow<T>){
1876 return compare(_begin,_size,a._begin,a._size);
1877 }
1878 [[nodiscard]]constexpr auto operator==(this_t a)noexcept(equal.nothrow<T>){
1879 return equal(_begin,_size,a._begin,a._size);
1880 }
1881 };
1882 template<typename T>
1885 using base_t::base_t;
1886
1887 [[nodiscard]]constexpr static size_t get_length_of(T*ptr){
1888 if(*ptr)return get_length_of(ptr+1)+1;
1889 else return 0;
1890 }
1891
1892 constexpr array_end_by_zero_t(T*ptr):base_t(ptr,get_length_of(ptr)){}
1893 };
1894
1895 template<class T>
1896 [[nodiscard]]inline constexpr T* begin_of_array_like(array_like_view_t<T>&a)noexcept requires(type_info<T>!=type_info<const T>){return a.begin();}
1897 template<class T>
1898 [[nodiscard]]inline constexpr auto begin_of_array_like(const array_like_view_t<T>&a)noexcept{return a.begin();}
1899 template<class T>
1900 [[nodiscard]]inline constexpr T* begin_of_array_like(array_like_view_t<remove_cv<T>>&a)noexcept{return a.begin();}
1901 template<class T>
1902 [[nodiscard]]inline constexpr size_t size_of_array_like(const array_like_view_t<T>&a)noexcept{return a.size();}
1903 }
1913
1914 //file_end
1915
1916 #line 27 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
1917 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/data.hpp"
1918 //data.hpp
1919 //at namespace elc::defs::base
1920 /*
1921 未完成的elc解释器base_defs文件
1922 由steve02081504与Alex0125设计、编写
1923 转载时请在不对此文件做任何修改的同时注明出处
1924 项目地址:https://github.com/steve02081504/ELC
1925 */
1926 /*
1927 每个T的可能性大小
1928 */
1929 template<class T> requires ::std::is_integral_v<T>
1930 constexpr size_t number_of_possible_values_per=max(type_info<::std::make_unsigned_t<T>>)+size_t{1};
1931 /*
1932 每个T有多少位
1933 */
1934 template<class T>
1935 constexpr size_t bitnumof=sizeof(T)*CHAR_BIT;
1936
1937 /*
1938 功能: byte* 类型数据转换为 T&,不进行任何检查
1939 用法: data_cast<T>(byte*) -> T&
1940 */
1941 template<class T>
1942 [[nodiscard]]constexpr T&data_cast(byte*p){return*::std::launder(reinterpret_cast<T*>(p));}
1943 /*
1944 功能: T* 指针转换为 byte*,不进行任何检查
1945 用法: cast_to_data(T*) -> byte*
1946 */
1947 template<class T>
1948 [[nodiscard]]constexpr byte*cast_to_data(T*p){return ::std::launder(reinterpret_cast<byte*>(p));}
1949 /*
1950 功能: const T* 指针转换为 const byte*,不进行任何检查
1951 用法: cast_to_data(const T*) -> const byte*
1952 */
1953 template<class T>
1954 [[nodiscard]]constexpr const byte*cast_to_data(const T*p){return ::std::launder(reinterpret_cast<const byte*>(p));}
1955
1956 /*
1957 功能: data_block类模板,接受多个类型参数,实例化为内含最大体积最大对齐要求的byte数组的结构体
1958 data_block -> byte*
1959 用法: data_block<T1,T2,...>value;
1960 */
1961 template<class...Ts>
1964 alignas(max({alignof(Ts)...}))
1965 byte _data[max({sizeof(Ts)...})];
1966 constexpr operator byte*(){return _data;}
1968 };
1969
1970 /*
1971 功能: data_view类模板,接受一个类型参数,提供对byte数组的访问和遍历
1972 用法: data_view<T>value{&value};
1973 */
1974 template<class T>
1976 using array_like_view_t<byte>::array_like_view_t;
1977 constexpr data_view(T*p):array_like_view_t<byte>{cast_to_data(p),sizeof(T)}{}
1978 };
1979 template<class T>
1980 struct data_view<const T>:array_like_view_t<const byte>{
1981 using array_like_view_t<const byte>::array_like_view_t;
1982 constexpr data_view(const T*p):array_like_view_t<const byte>{cast_to_data(p),sizeof(T)}{}
1983 };
1984
1985 /*
1986 功能: 比较两个类实例在内存中的内容是否相同
1987 用法: full_equal_in_byte(const T&a,const T&b) -> bool
1988 */
1989 template<class T>
1990 [[nodiscard]]constexpr bool full_equal_in_byte(const T&a,const T&b){
1991 return equal(cast_to_data(&a),cast_to_data(&b),sizeof(T));
1992 }
1993
1994 //file_end
1995
1996 #line 28 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
1997 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/pointer.hpp"
1998 //pointer.hpp
1999 //at namespace elc::defs::base
2000 /*
2001 未完成的elc解释器base_defs文件
2002 由steve02081504与Alex0125设计、编写
2003 转载时请在不对此文件做任何修改的同时注明出处
2004 项目地址:https://github.com/steve02081504/ELC
2005 */
2006
2010 template<typename T>
2011 [[nodiscard]]constexpr auto pointer_to_bool(T*a)noexcept{
2013 return the_pointer_to_bool(a);
2014 else
2015 return null_ptr!=a;
2016 }
2017
2021 template<typename T>
2022 [[nodiscard]]constexpr auto pointer_equal(T*a,T*b)noexcept{
2023 if constexpr(was_not_an_ill_form(the_pointer_equal(a,b)))
2024 return the_pointer_equal(a,b);
2025 else
2026 return a==b;
2027 }
2028
2030 template<class T>
2031 inline constexpr bool is_pointer= ::std::is_pointer_v<T>;
2033 typedef void*pointer;
2035 typedef const void*const_pointer;
2036
2038 [[nodiscard]]constexpr ptrdiff_t get_off_set(note::from_t<const_pointer>a,note::to_t<const_pointer>b)noexcept{
2039 return cast_to_data(b())-cast_to_data(a());//b-a == c
2040 }
2042 template<class T>
2043 [[nodiscard]]constexpr auto apply_off_set(T*a,ptrdiff_t c)noexcept{
2044 return cast_to_data(a)+c;//a+c == b
2045 }
2047 template<class T>
2048 [[nodiscard]]constexpr auto unapply_off_set(T*b,ptrdiff_t c)noexcept{
2049 return cast_to_data(b)-c;//b-c == a
2050 }
2051
2052 //file_end
2053
2054 #line 29 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
2055 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/hash.hpp"
2056 //hash.hpp
2057 //at namespace elc::defs::base
2058 /*
2059 未完成的elc解释器base_defs文件
2060 由steve02081504与Alex0125设计、编写
2061 转载时请在不对此文件做任何修改的同时注明出处
2062 项目地址:https://github.com/steve02081504/ELC
2063 */
2064 namespace hash_n{
2065 typedef size_t hash_base_t;
2068 constexpr hash_base_t operator%(auto&&a)const noexcept{
2069 return _value%a;
2070 }
2071 constexpr bool operator==(const hash_value_t&a)const noexcept{
2072 return _value==a._value;
2073 }
2074 };
2077 };
2078
2079 template<class T>
2080 inline constexpr bool is_unstable_hash = type_info<T const>.can_convert_to<unstable_hash_value_t>;
2081 template<class T>
2082 inline constexpr bool is_fundamental_hash = ::std::is_fundamental_v<T>;
2083
2084 enable_adl(the_pointer_hash);
2085 template<class T>
2086 [[nodiscard]]inline constexpr hash_value_t pointer_hash(T*a)noexcept{
2087 if constexpr(was_not_an_ill_form(the_pointer_hash(a)))
2088 return the_pointer_hash(a);
2089 else
2090 return{hash_base_t(a)};
2091 }
2092
2093 inline struct hash_t{
2094 template<class T>
2095 [[nodiscard]]static constexpr inline bool nothrow_helper()noexcept{
2096 if constexpr(is_pointer<T>)
2097 return noexcept(pointer_hash(declvalue(const T&)));
2098 elseif constexpr(is_fundamental_hash<T>)
2099 return noexcept(hash_value_t{hash_base_t(declvalue(const T&))});
2100 elseif constexpr(is_unstable_hash<T>)
2101 return noexcept(unstable_hash_value_t(declvalue(const T&)));
2102 elseif constexpr(was_not_an_ill_form(declvalue(const T&).hash()))
2103 return noexcept(declvalue(const T&).hash());
2104 elseif constexpr(was_not_an_ill_form(hash_value_t(declvalue(const T&))))
2105 return noexcept(hash_value_t(declvalue(const T&)));
2106 elseif constexpr(type_info<remove_cv<T>> == type_info<base_type_info_t>)
2107 return true;
2108 else
2109 return false;
2110 }
2111 template<class T>
2112 static constexpr bool nothrow=nothrow_helper<T>();
2113 template<class T>
2114 [[nodiscard]]static constexpr inline bool able_helper()noexcept{
2115 if constexpr(is_pointer<T>)
2116 return true;
2117 elseif constexpr(is_fundamental_hash<T>)
2118 return true;
2119 elseif constexpr(is_unstable_hash<T>)
2120 return true;
2121 elseif constexpr(was_not_an_ill_form(declvalue(const T&).hash()))
2122 return true;
2123 elseif constexpr(was_not_an_ill_form(hash_value_t(declvalue(const T&))))
2124 return true;
2125 elseif constexpr(type_info<remove_cv<T>> == type_info<base_type_info_t>)
2126 return true;
2127 else
2128 return false;
2129 }
2130 template<class T>
2131 static constexpr bool able=able_helper<T>();
2132
2133 #define hash operator()
2134
2135 [[nodiscard]]inline constexpr hash_value_t hash(nothing)const noexcept{
2136 return{hash_base_t(nothing)};
2137 }
2138 [[nodiscard]]inline hash_value_t hash(const base_type_info_t&a)const noexcept{
2139 return{a.get_hash()};
2140 }
2141 template<class T> requires able<T>
2142 [[nodiscard]]constexpr_as_auto inline auto hash(const T&a)const noexcept(nothrow<T>){
2143 #undef hash
2144 if constexpr(is_pointer<T>)
2145 return pointer_hash(a);
2146 elseif constexpr(is_fundamental_hash<T>)
2147 return hash_value_t{hash_base_t(a)};
2148 elseif constexpr(is_unstable_hash<T>)
2149 return unstable_hash_value_t(a);
2150 elseif constexpr(was_not_an_ill_form(declvalue(const T&).hash()))
2151 return a.hash();
2152 elseif constexpr(was_not_an_ill_form(hash_value_t(declvalue(const T&))))
2153 return hash_value_t(a);
2154 else{
2155 template_error("Please overload the function hash in the namespace where this type is defined.");
2156 return hash_value_t{};
2157 }
2158 #define hash operator()
2159 }
2160 template<class T>
2161 [[nodiscard]]constexpr_as_auto inline hash_base_t get_hash_in_base_type(const T&a)const noexcept(nothrow<T>){
2162 return hash(a)._value;
2163 }
2164
2165 /*从某个起始点算起的hash*/
2166 template<class T>
2167 [[nodiscard]]force_inline constexpr hash_value_t with_calculated_before(hash_value_t before,size_t before_size,const T*a,size_t size)const noexcept{
2168 hash_base_t aret=before._value;
2169 rot_iterator<decltype(aret)>rotl_offset = before_size+size;
2170 while(size--){
2171 aret ^= rotl(get_hash_in_base_type(a[size]),rotl_offset);
2172 rotl_offset--;
2173 }
2174 return{aret};
2175 }
2176 /*计算此hash重复N次的数组的hash结果*/
2177 [[nodiscard]]force_inline constexpr hash_value_t repeat_times(hash_value_t value,size_t size)const noexcept{
2178 hash_base_t aret=0;
2179 {
2180 //优化.
2181 //关於此,咱确信咱发现一种美妙的证法来保证这个优化不影响结果,但可惜凋可怜的脑容量不足以让他看懂.
2182 constexpr size_t bit_range_max=bitnum_of(hash_base_t);
2183 constexpr hash_base_t void_hash{nothing};
2184 suppress_msvc_warning(26475)//强制转换警告diss.
2185 constexpr hash_base_t npos_hash{hash_base_t(-1)};
2186 constexpr size_t bitnumof_void=bit_range_max*BIT_POSSIBILITY;
2187
2188 size=size%bitnumof_void;
2189 if(value._value==0 || size==0)
2190 return {void_hash};
2191 if(size >= bit_range_max){
2192 const bool is_npos = ::std::popcount(value._value)%BIT_POSSIBILITY;
2193 aret = is_npos?npos_hash:void_hash;
2194 size-=bit_range_max;
2195 }
2196 if(!size)
2197 return {aret};
2198 }
2199 rot_iterator<decltype(aret)>rotl_offset = size;
2200 while(size--){
2201 aret ^= rotl(value._value,rotl_offset);
2202 rotl_offset--;
2203 }
2204 return{aret};
2205 }
2206 /*计算此hash重复N次的数组的hash结果*/
2207 template<class T>
2208 [[nodiscard]]force_inline constexpr hash_value_t repeat_times(T&&value,size_t size)const noexcept{
2209 return repeat_times(hash(value),size);
2210 }
2211 template<class T>
2212 [[nodiscard]]constexpr inline hash_value_t hash(const T*a,size_t size)const noexcept(nothrow<const T>){
2213 return with_calculated_before(hash(nothing),0,a,size);
2214 }
2215 /*合并两个数据段的hash结果,好似计算这两个数据段合并后的hash结果一般*/
2217 hash_value_t before,size_t before_size,hash_value_t after,[[maybe_unused]]size_t after_size
2218 )const noexcept{
2219 return{before._value^(rotl(after._value,before_size))};
2220 }
2221 template<class T> requires is_not_signal_value_for_array_like<T>
2222 [[nodiscard]]constexpr inline hash_value_t hash(const array_like_view_t<T>a)const noexcept(nothrow<T>){
2223 return hash(a.begin(),a.size());
2224 }
2225 template<class T> requires is_not_signal_value_for_array_like<T>
2226 [[nodiscard]]constexpr inline hash_value_t with_calculated_before(hash_value_t before,size_t before_size,const array_like_view_t<T>a)const noexcept{
2227 return with_calculated_before(before,before_size,a.begin(),a.size());
2228 }
2229
2230 #undef hash
2231
2233 }
2238 using hash_n::hash;
2239
2240 //file_end
2241
2242 #line 30 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
2243 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/range.hpp"
2244 //range.hpp
2245 //at namespace elc::defs::base
2246 /*
2247 未完成的elc解释器base_defs文件
2248 由steve02081504与Alex0125设计、编写
2249 转载时请在不对此文件做任何修改的同时注明出处
2250 项目地址:https://github.com/steve02081504/ELC
2251 */
2252 namespace range_n{
2253 // range_t
2255 template<typename T>
2256 struct range_t{
2257 T _begin,_end;
2258 //_begin<=_end
2259 constexpr range_t(const T begin,const T end):_begin(begin),_end(end){}
2260 constexpr range_t(note::from_t<const T>begin,note::to_t<const T>end):_begin(begin),_end(end+1){}
2261 constexpr range_t(note::to_t<const T>end,note::from_t<const T>begin):_begin(begin),_end(end+1){}
2262 constexpr range_t(const T begin,note::size_t<const T>size):_begin(begin),_end(begin+size()){}
2263 constexpr range_t(const T begin,note::size_t<size_t>size):_begin(begin),_end(begin+size()){}
2264
2265 constexpr size_t size()noexcept{return _end-_begin;}
2266 constexpr auto end()noexcept{return _end;}
2267 constexpr auto begin()noexcept{return _begin;}
2268 constexpr auto end()const noexcept{return _end;}
2269 constexpr auto begin()const noexcept{return _begin;}
2270
2271 template <class U> requires(type_info<T>.can_convert_to<U>)
2272 constexpr operator range_t<U>()const noexcept(type_info<T>.can_nothrow_convert_to<U>){
2273 return {_begin,_end};
2274 }
2275 };
2276
2277 template<class T>
2278 [[nodiscard]]inline auto size_of_array_like(range_t<T*>&a)noexcept{return a.size();}
2279 template<class T>
2280 [[nodiscard]]inline auto size_of_array_like(range_t<const T*>&a)noexcept{return a.size();}
2281
2282 template<class T>
2283 [[nodiscard]]inline auto begin_of_array_like(range_t<T*>&a)noexcept{return a.begin();}
2284 template<class T>
2285 [[nodiscard]]inline auto begin_of_array_like(range_t<const T*>&a)noexcept{return a.begin();}
2286
2287 // in_range
2289 template<typename T>
2290 [[nodiscard]]constexpr bool in_range(T pattern,const range_t<T>range)noexcept_as(bool(declvalue(T)>=declvalue(const T) && declvalue(T)<=declvalue(const T))){//算术类型或指针
2291 return bool(pattern>=range.begin() && pattern<range.end());
2292 }
2293 // in_range
2295 template<typename T>
2296 [[nodiscard]]constexpr bool in_range(T*pattern,const range_t<byte*>range)noexcept{
2297 return cast_to_data(pattern)>=range.begin() && cast_to_data(pattern)<range.end();
2298 }
2299 // match_pattern
2302 template<typename T>
2305 typedef unsigned char index_type;
2306
2307 size_t skip_table[number_of_possible_values_per<index_type>]{};
2308 size_t radical_skip_table[number_of_possible_values_per<index_type>]{};
2309 index_type pre_index_table[number_of_possible_values_per<index_type>]{};
2310
2311 static constexpr index_type get_index_of(T&ch)noexcept{
2312 return index_type(hash(ch) % number_of_possible_values_per<index_type>);
2313 }
2314 constexpr void build_table(array_like_view_t<T>pattern)noexcept{
2315 const size_t m=pattern.size();
2316 if(!m)
2317 return;
2318 for(size_t i=0;i<number_of_possible_values_per<index_type>;i++){
2319 skip_table[i]=radical_skip_table[i]=m;
2320 }
2321 skip_table[get_index_of(pattern[0])]=radical_skip_table[get_index_of(pattern[0])]=m-1;//单独处理pattern[0]的情况
2322 for(size_t i=1;i<m-1;i++){
2323 index_type index=get_index_of(pattern[i]);//radical_skip_table[index]表示pattern中倒数第二次出现的index到pattern末尾的距离
2324 radical_skip_table[index]=skip_table[index];//当index在pattern中出现0次或1次时,radical_skip_table[index]等于模式串长度m
2325 skip_table[index]=m-i-1;//skip数组的定义与BMH算法相同
2326 pre_index_table[index]=get_index_of(pattern[i-1]);
2327 }
2328 }
2329 constexpr match_pattern(array_like_view_t<T>pattern)noexcept:_pattern(pattern){
2330 build_table(_pattern);
2331 }
2332 [[nodiscard]]constexpr T* match(array_like_view_t<T>range)const noexcept{
2333 size_t m = _pattern.size();
2334 if(!m)
2335 return range.begin();
2336 size_t n= range.size();
2337 size_t i= m-1;
2338 while(i<n){
2339 size_t k=i;
2340 ptrdiff_t j=m-1;//k记录text中每次从右至左开始比较的起始位置
2341 while((j>=0)&&(_pattern[j]==range[i])){
2342 i--;j--;
2343 }
2344 if(j==-1)
2345 return addressof(range[i+1]);//在range[i+1]处匹配成功
2346 index_type index_k=get_index_of(range[k]);
2347 if(get_index_of(range[k-1])!=pre_index_table[index_k])
2348 i=k+radical_skip_table[index_k];//采用激进策略移动文本指针
2349 else
2350 i=k+skip_table[index_k];
2351 }
2352 return nullptr;//匹配失败
2353 }
2354 };
2355 // reverse_match_pattern
2358 template<typename T>
2361 typedef unsigned char index_type;
2362
2363 size_t skip_table[number_of_possible_values_per<index_type>]{};
2364 size_t radical_skip_table[number_of_possible_values_per<index_type>]{};
2365 index_type pre_index_table[number_of_possible_values_per<index_type>]{};
2366
2367 static constexpr index_type get_index_of(T&ch)noexcept{
2368 return index_type(hash(ch) % number_of_possible_values_per<index_type>);
2369 }
2370 constexpr void build_table(array_like_view_t<T>pattern)noexcept{
2371 const size_t m=pattern.size();
2372 if(!m)
2373 return;
2374 for(size_t i=0;i<number_of_possible_values_per<index_type>;i++){
2375 skip_table[i]=radical_skip_table[i]=m;
2376 }
2377 skip_table[get_index_of(pattern[m-1])]=radical_skip_table[get_index_of(pattern[m-1])]=m-1;//单独处理pattern[m-1]的情况
2378 for(ptrdiff_t i=m-2;i>=0;i--){
2379 index_type index=get_index_of(pattern[i]);//radical_skip_table[index]表示pattern中倒数第二次出现的index到pattern末尾的距离
2380 radical_skip_table[index]=skip_table[index];//当index在pattern中出现0次或1次时,radical_skip_table[index]等于模式串长度m
2381 skip_table[index]=i;//skip数组的定义与BMH算法相同
2382 pre_index_table[index]=get_index_of(pattern[i+1]);
2383 }
2384 }
2385 constexpr reverse_match_pattern(array_like_view_t<T>pattern)noexcept:_pattern(pattern){
2386 build_table(_pattern);
2387 }
2388 [[nodiscard]]constexpr T* match(array_like_view_t<T>range)const noexcept{
2389 size_t m=_pattern.size();
2390 if(!m)
2391 return range.begin();
2392 size_t n= range.size();
2393 ptrdiff_t i= n-m;
2394 while(i>=0){
2395 size_t k=i;
2396 size_t j=0;//k记录text中每次从右至左开始比较的起始位置
2397 while((j<=m-1)&&(_pattern[j]==range[i])){
2398 i++;j++;
2399 }
2400 if(j==m)
2401 return addressof(range[k]);//在range[k]处匹配成功
2402 index_type index_k=get_index_of(range[k]);
2403 if(get_index_of(range[k+1])!=pre_index_table[index_k])
2404 i=k-radical_skip_table[index_k];//采用激进策略移动文本指针
2405 else
2406 i=k-skip_table[index_k];
2407 }
2408 return nullptr;//匹配失败
2409 }
2410 };
2411 suppress_msvc_warning(26475)//强制转换警告diss
2412 // npos
2414 static constexpr size_t npos = size_t(-1);
2416 template<typename T>
2417 [[nodiscard]]constexpr T* in_range(T&pattern,array_like_view_t<T>range){
2418 for(auto&i : range){
2419 if(i==pattern)
2420 return addressof(i);
2421 }
2422 return nullptr;
2423 }
2425 template<typename T>
2426 [[nodiscard]]constexpr size_t in_range_size_t(T&pattern,array_like_view_t<T>range){
2427 auto result = in_range(pattern,range);
2428 if(result)
2429 return result - range.begin();
2430 else
2431 return npos;
2432 }
2433 // 数据串匹配by steve02081504.
2435 template<typename T>
2436 [[nodiscard]]constexpr T* in_range(array_like_view_t<T>pattern,array_like_view_t<T>range){
2437 if(range.size() >= 512 && pattern.size() >= 11){
2438 match_pattern tmp=pattern;
2439 return tmp.match(range);
2440 }
2441
2442 size_t off_set=0;
2443 size_t matching_off_set=1;
2444
2445 floop{
2446 matching_off_set=1;
2447 while(pattern.end()[0-matching_off_set]==range.begin()[off_set+pattern.size()-matching_off_set])
2448 if(matching_off_set==pattern.size())
2449 return addressof(range.begin()[off_set]);
2450 else
2451 matching_off_set++;
2452 if(off_set+pattern.size() >= range.size())
2453 return nullptr;
2454 auto tmp = in_range(range.begin()[off_set+pattern.size()], pattern);
2455 if(!tmp)
2456 tmp=pattern.begin();
2457 off_set+=pattern.end()-tmp;
2458 }
2459 }
2461 template<typename T>
2462 [[nodiscard]]constexpr size_t in_range_size_t(array_like_view_t<T>pattern,array_like_view_t<T>range){
2463 auto result = in_range(pattern,range);
2464 if(result)
2465 return result - range.begin();
2466 else
2467 return npos;
2468 }
2470 template<typename T>
2471 [[nodiscard]]constexpr T* in_range_but_reverse(T&pattern,array_like_view_t<T>range){
2472 for(auto&i : range|::std::views::reverse){
2473 if(i==pattern)
2474 return addressof(i);
2475 }
2476 return nullptr;
2477 }
2479 template<typename T>
2480 [[nodiscard]]constexpr size_t in_range_but_reverse_size_t(T&pattern,array_like_view_t<T>range){
2481 auto result = in_range_but_reverse(pattern,range);
2482 if(result)
2483 return result - range.begin();
2484 else
2485 return npos;
2486 }
2487 // 反向数据串匹配by steve02081504.
2489 template<typename T>
2491 if(range.size() >= 512 && pattern.size() >= 11){
2492 reverse_match_pattern tmp = pattern;
2493 return tmp.match(range);
2494 }
2495
2496 size_t off_set=0;
2497 size_t matching_off_set=0;
2498
2499 floop{
2500 matching_off_set=0;
2501 while(pattern.begin()[matching_off_set]==range.end()[0-(off_set+pattern.size()-matching_off_set)])
2502 if(matching_off_set==pattern.size()-1)
2503 return addressof(range.end()[0-(off_set+pattern.size())]);
2504 else
2505 matching_off_set++;
2506 if(off_set+pattern.size() >= range.size())
2507 return nullptr;
2508 auto tmp = in_range_but_reverse(range.end()[0-(off_set+pattern.size()+1)], pattern);
2509 if(!tmp)
2510 tmp=pattern.end()-1;
2511 off_set+=tmp-pattern.begin();
2512 off_set+=1;
2513 }
2514 }
2516 template<typename T>
2518 auto result = in_range_but_reverse(pattern,range);
2519 if(result)
2520 return result - range.begin();
2521 else
2522 return npos;
2523 }
2524
2525 // bitmark_for_finds
2528 template<typename T>
2530 typedef unsigned char index_type;
2531 bool _bitmark[number_of_possible_values_per<index_type>]{};
2532
2533 bitmark_for_finds()noexcept=default;
2534 [[nodiscard]]constexpr bool mark(array_like_view_t<T>pattern)noexcept{
2535 if constexpr(number_of_possible_values_per<T> > number_of_possible_values_per<index_type>){
2536 for(auto& i: pattern){
2537 if(::std::make_unsigned_t<T>(i) >= number_of_possible_values_per<index_type>)
2538 return false;
2539 _bitmark[index_type(i)] = true;
2540 }
2541 }
2542 else{
2543 for(auto& i: pattern)
2544 _bitmark[index_type(i)] = true;
2545 }
2546 return true;
2547 }
2548 [[nodiscard]]constexpr bool operator[](T&index)const noexcept{
2549 if constexpr(number_of_possible_values_per<T> > number_of_possible_values_per<index_type>)
2550 if(::std::make_unsigned_t<T>(index) >= number_of_possible_values_per<index_type>)
2551 return false;
2552 return _bitmark[index_type(index)];
2553 }
2554 };
2557 template<typename T>
2558 [[nodiscard]]constexpr T* find_first_of_bitmark(const bitmark_for_finds<T>&mark,array_like_view_t<T>range){
2559 for(auto&i : range){
2560 if(mark[i])
2561 return addressof(i);
2562 }
2563 return nullptr;
2564 }
2567 template<typename T>
2568 [[nodiscard]]constexpr T* base_find_first_of(array_like_view_t<T>pattern,array_like_view_t<T>range){
2569 for(auto&i : range){
2570 if(in_range(i,pattern))
2571 return addressof(i);
2572 }
2573 return nullptr;
2574 }
2575 // find_first_of
2577 template<typename T>
2578 [[nodiscard]]constexpr T* find_first_of(array_like_view_t<T>pattern,array_like_view_t<T>range){
2579 if constexpr(::std::is_integral_v<T>){
2581 if(mark.mark(pattern))
2582 return find_first_of_bitmark(mark,range);
2583 }
2584 return base_find_first_of(pattern,range);
2585 }
2587 template<typename T>
2588 [[nodiscard]]constexpr size_t find_first_of_size_t(array_like_view_t<T>pattern,array_like_view_t<T>range){
2589 auto result = find_first_of(pattern,range);
2590 if(result)
2591 return result - range.begin();
2592 else
2593 return npos;
2594 }
2597 template<typename T>
2598 [[nodiscard]]constexpr T* find_last_of_bitmark(const bitmark_for_finds<T>&mark,array_like_view_t<T>range){
2599 for(auto& i: range|::std::views::reverse){
2600 if(mark[i])
2601 return addressof(i);
2602 }
2603 }
2606 template<typename T>
2607 [[nodiscard]]constexpr T* base_find_last_of(array_like_view_t<T>pattern,array_like_view_t<T>range){
2608 for(auto&i : range|::std::views::reverse){
2609 if(in_range(i,pattern))
2610 return addressof(i);
2611 }
2612 return nullptr;
2613 }
2614 // find_last_of
2616 template<typename T>
2617 [[nodiscard]]constexpr T* find_last_of(array_like_view_t<T>pattern,array_like_view_t<T>range){
2618 if constexpr(::std::is_integral_v<T>){
2620 if(mark.mark(pattern))
2621 return find_last_of_bitmark(mark,range);
2622 }
2623 return base_find_last_of(pattern,range);
2624 }
2626 template<typename T>
2627 [[nodiscard]]constexpr size_t find_last_of_size_t(array_like_view_t<T>pattern,array_like_view_t<T>range){
2628 auto result = find_last_of(pattern,range);
2629 if(result)
2630 return result - range.begin();
2631 else
2632 return npos;
2633 }
2636 template<typename T>
2637 [[nodiscard]]constexpr T* find_first_not_of_bitmark(const bitmark_for_finds<T>&mark,array_like_view_t<T>range){
2638 for(auto& i: range){
2639 if(!mark[i])
2640 return addressof(i);
2641 }
2642 return nullptr;
2643 }
2646 template<typename T>
2648 for(auto&i : range){
2649 if(!in_range(i,pattern))
2650 return addressof(i);
2651 }
2652 return nullptr;
2653 }
2654 // find_first_not_of
2656 template<typename T>
2657 [[nodiscard]]constexpr T* find_first_not_of(array_like_view_t<T>pattern,array_like_view_t<T>range){
2658 if constexpr(::std::is_integral_v<T>){
2660 if(mark.mark(pattern))
2661 return find_first_not_of_bitmark(mark,range);
2662 }
2663 return base_find_first_not_of(pattern,range);
2664 }
2666 template<typename T>
2667 [[nodiscard]]constexpr size_t find_first_not_of_size_t(array_like_view_t<T>pattern,array_like_view_t<T>range){
2668 auto result = find_first_not_of(pattern,range);
2669 if(result)
2670 return result - range.begin();
2671 else
2672 return npos;
2673 }
2676 template<typename T>
2677 [[nodiscard]]constexpr T* find_last_not_of_bitmark(const bitmark_for_finds<T>&mark,array_like_view_t<T>range){
2678 for(auto& i: range|::std::views::reverse){
2679 if(!mark[i])
2680 return addressof(i);
2681 }
2682 return nullptr;
2683 }
2686 template<typename T>
2688 for(auto&i : range|::std::views::reverse){
2689 if(!in_range(i,pattern))
2690 return addressof(i);
2691 }
2692 return nullptr;
2693 }
2694 // find_last_not_of
2696 template<typename T>
2697 [[nodiscard]]constexpr T* find_last_not_of(array_like_view_t<T>pattern,array_like_view_t<T>range){
2698 if constexpr(::std::is_integral_v<T>){
2700 if(mark.mark(pattern))
2701 return find_last_not_of_bitmark(mark,range);
2702 }
2703 return base_find_last_not_of(pattern,range);
2704 }
2706 template<typename T>
2707 [[nodiscard]]constexpr size_t find_last_not_of_size_t(array_like_view_t<T>pattern,array_like_view_t<T>range){
2708 auto result = find_last_not_of(pattern,range);
2709 if(result)
2710 return result - range.begin();
2711 else
2712 return npos;
2713 }
2714 }
2715 using range_n::range_t;
2716 using range_n::in_range;
2724
2725 //file_end
2726
2727 #line 31 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
2728 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/string_view.hpp"
2729 //string_view.hpp
2730 //at namespace elc::defs::base
2731 /*
2732 未完成的elc解释器base_defs文件
2733 由steve02081504与Alex0125设计、编写
2734 转载时请在不对此文件做任何修改的同时注明出处
2735 项目地址:https://github.com/steve02081504/ELC
2736 */
2737 //仅是声明
2738 namespace constexpr_str_n {
2739 template<typename char_T>
2740 struct constexpr_str_t;
2741 }
2743 //重载range操作
2744 //仅是声明以及size_t包装
2745 namespace range_n {
2746 template<typename T>
2747 [[nodiscard]]constexpr T* in_range(const constexpr_str_t<T>&pattern,array_like_view_t<T>range);
2748 //若成功找到匹配的数据项,返回其距离开头的步数,若未找到,返回npos
2749 template<typename T>
2750 [[nodiscard]]constexpr size_t in_range_size_t(const constexpr_str_t<T>&pattern,array_like_view_t<T>range){
2751 auto result = in_range(pattern, range);
2752 if(result)
2753 return result - range.data();
2754 else
2755 return npos;
2756 }
2757 template<typename T>
2758 [[nodiscard]]constexpr T* in_range_but_reverse(const constexpr_str_t<T>&pattern,array_like_view_t<T>range);
2759 //若成功找到匹配的数据项,返回其距离开头的步数,若未找到,返回npos
2760 template<typename T>
2761 [[nodiscard]]constexpr size_t in_range_but_reverse_size_t(const constexpr_str_t<T>&pattern,array_like_view_t<T>range){
2762 auto result = in_range_but_reverse(pattern, range);
2763 if(result)
2764 return result - range.data();
2765 else
2766 return npos;
2767 }
2768 template<typename T>
2769 [[nodiscard]]constexpr T* find_first_of(const constexpr_str_t<T>&pattern,array_like_view_t<T>range);
2770 //若成功找到匹配的数据项,返回其距离开头的步数,若未找到,返回npos
2771 template<typename T>
2772 [[nodiscard]]constexpr size_t find_first_of_size_t(const constexpr_str_t<T>&pattern,array_like_view_t<T>range){
2773 auto result = find_first_of(pattern, range);
2774 if(result)
2775 return result - range.data();
2776 else
2777 return npos;
2778 }
2779 template<typename T>
2780 [[nodiscard]]constexpr T* find_last_of(const constexpr_str_t<T>&pattern,array_like_view_t<T>range);
2781 //若成功找到匹配的数据项,返回其距离开头的步数,若未找到,返回npos
2782 template<typename T>
2783 [[nodiscard]]constexpr size_t find_last_of_size_t(const constexpr_str_t<T>&pattern,array_like_view_t<T>range){
2784 auto result = find_last_of(pattern, range);
2785 if(result)
2786 return result - range.data();
2787 else
2788 return npos;
2789 }
2790 template<typename T>
2791 [[nodiscard]]constexpr T* find_first_not_of(const constexpr_str_t<T>&pattern,array_like_view_t<T>range);
2792 //若成功找到不匹配的数据项,返回其距离开头的步数,若未找到,返回npos
2793 template<typename T>
2794 [[nodiscard]]constexpr size_t find_first_not_of_size_t(const constexpr_str_t<T>&pattern,array_like_view_t<T>range){
2795 auto result = find_first_not_of(pattern, range);
2796 if(result)
2797 return result - range.data();
2798 else
2799 return npos;
2800 }
2801 template<typename T>
2802 [[nodiscard]]constexpr T* find_last_not_of(const constexpr_str_t<T>&pattern,array_like_view_t<T>range);
2803 //若成功找到不匹配的数据项,返回其距离开头的步数,若未找到,返回npos
2804 template<typename T>
2805 [[nodiscard]]constexpr T* find_last_not_of_size_t(const constexpr_str_t<T>&pattern,array_like_view_t<T>range){
2806 auto result = find_last_not_of(pattern,range);
2807 if(result)
2808 return result - range.begin();
2809 else
2810 return npos;
2811 }
2812 }
2813 //开始定义
2814 namespace string_view_n{
2816 template<typename char_T>
2817 struct string_view_t:array_like_view_t<const char_T>{
2818 static constexpr size_t npos=range_n::npos;
2820 //构造函数
2821 using base_t::base_t;
2822 constexpr string_view_t(const char_T*str)noexcept:string_view_t(array_end_by_zero_t<const char_T>(str)){}
2823 //成员函数
2824 [[nodiscard]]constexpr const char_T*str()const noexcept{return base_t::cbegin();}
2825 [[nodiscard]]constexpr const char_T*data()const noexcept{return base_t::cbegin();}
2826 [[nodiscard]]constexpr operator const char_T*()const noexcept{return str();}
2827 //substr
2828 [[nodiscard]]constexpr string_view_t substr(size_t pos,size_t len)const noexcept{
2829 return string_view_t(base_t::cbegin()+pos,len);
2830 }
2831 [[nodiscard]]constexpr string_view_t substr(size_t pos)const noexcept{
2832 return string_view_t(base_t::cbegin()+pos,base_t::size()-pos);
2833 }
2834 [[nodiscard]]constexpr string_view_t substr(size_t pos,const char_T*end)const noexcept{
2835 return string_view_t(base_t::cbegin()+pos,end-base_t::cbegin());
2836 }
2837 [[nodiscard]]constexpr string_view_t substr(const char_T*begin,size_t len)const noexcept{
2838 return string_view_t(begin,len);
2839 }
2840 [[nodiscard]]constexpr string_view_t substr(const char_T*begin)const noexcept{
2841 return string_view_t(begin,base_t::size());
2842 }
2843 [[nodiscard]]constexpr string_view_t substr(const char_T*begin,const char_T*end)const noexcept{
2844 return string_view_t(begin,end-begin);
2845 }
2846 //find
2847 [[nodiscard]]constexpr size_t find(const char_T ch)const{
2848 return in_range_size_t(ch, *this);
2849 }
2850 [[nodiscard]]constexpr size_t reverse_find(const char_T ch)const{
2851 return in_range_but_reverse_size_t(ch, *this);
2852 }
2853 [[nodiscard]]constexpr size_t find(string_view_t str)const{
2854 return in_range_size_t(str, *this);
2855 }
2856 [[nodiscard]]constexpr size_t reverse_find(string_view_t str)const{
2857 return in_range_but_reverse_size_t(str, *this);
2858 }
2859 [[nodiscard]]constexpr size_t find(const constexpr_str_t<char_T>&str)const{
2860 return in_range_size_t(str, *this);
2861 }
2862 [[nodiscard]]constexpr size_t reverse_find(const constexpr_str_t<char_T>&str)const{
2863 return in_range_but_reverse_size_t(str, *this);
2864 }
2865 //others by range_n::find_last_of_size_t etc
2866 [[nodiscard]]constexpr size_t find_first_of(const char_T ch)const{
2867 return range_n::find_first_of_size_t(ch, *this);
2868 }
2869 [[nodiscard]]constexpr size_t find_last_of(const char_T ch)const{
2870 return range_n::find_last_of_size_t(ch, *this);
2871 }
2872 [[nodiscard]]constexpr size_t find_first_not_of(const char_T ch)const{
2873 return range_n::find_first_not_of_size_t(ch, *this);
2874 }
2875 [[nodiscard]]constexpr size_t find_last_not_of(const char_T ch)const{
2876 return range_n::find_last_not_of_size_t(ch, *this);
2877 }
2878 [[nodiscard]]constexpr size_t find_first_of(string_view_t str)const{
2879 return range_n::find_first_of_size_t(str, *this);
2880 }
2881 [[nodiscard]]constexpr size_t find_last_of(string_view_t str)const{
2882 return range_n::find_last_of_size_t(str, *this);
2883 }
2884 [[nodiscard]]constexpr size_t find_first_not_of(string_view_t str)const{
2885 return range_n::find_first_not_of_size_t(str, *this);
2886 }
2887 [[nodiscard]]constexpr size_t find_last_not_of(string_view_t str)const{
2888 return range_n::find_last_not_of_size_t(str, *this);
2889 }
2890 [[nodiscard]]constexpr size_t find_first_of(const constexpr_str_t<char_T>&str)const{
2891 return range_n::find_first_of_size_t(str, *this);
2892 }
2893 [[nodiscard]]constexpr size_t find_last_of(const constexpr_str_t<char_T>&str)const{
2894 return range_n::find_last_of_size_t(str, *this);
2895 }
2896 [[nodiscard]]constexpr size_t find_first_not_of(const constexpr_str_t<char_T>&str)const{
2897 return range_n::find_first_not_of_size_t(str, *this);
2898 }
2899 [[nodiscard]]constexpr size_t find_last_not_of(const constexpr_str_t<char_T>&str)const{
2900 return range_n::find_last_not_of_size_t(str, *this);
2901 }
2902 };
2904 }
2907
2908 //file_end
2909
2910 #line 32 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
2911 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/type_name.hpp"
2912 //type_name.hpp
2913 //at namespace elc::defs::base
2914 /*
2915 未完成的elc解释器base_defs文件
2916 由steve02081504与Alex0125设计、编写
2917 转载时请在不对此文件做任何修改的同时注明出处
2918 项目地址:https://github.com/steve02081504/ELC
2919 */
2921 //对于gcc和clang,这个类型有一个malloced的char*,以便于在析构时释放
2922 //一切源于abi::__cxa_demangle
2923 //对于msvc,这个类型析构时不需要做任何事情
2926 static base_t demangle(const char*original_name)noexcept{
2927 push_and_disable_msvc_warning(26494);//未初始化警告diss
2928 size_t len;
2929 const char*demangled_name;
2931 #if defined(__clang__)||defined(__GNUC__)
2932 //gcc和clang
2933 //使用abi::__cxa_demangle重整
2934 int status;
2935 demangled_name=::abi::__cxa_demangle(original_name,nullptr,&len,&status);
2936 if(status!=0){
2937 demangled_name=original_name;
2938 len=::std::strlen(original_name);
2939 ::std::free((void*)demangled_name);
2940 }
2941 #else
2942 //msvc
2943 //不需要重整
2944 demangled_name=original_name;
2945 len=::std::strlen(original_name);
2946 #endif
2947 return base_t{demangled_name,len};
2948 }
2950 static base_t copy_demangle(base_t demangled_name)noexcept{
2951 #if defined(__clang__)||defined(__GNUC__)
2952 //gcc和clang
2953 //需要复制重整结果(用malloced的char*)
2954 char*copyed_name=(char*)::std::malloc(demangled_name.size()+1);
2955 if(copyed_name==nullptr)
2956 return base_t{nullptr,0};
2957 ::std::memcpy(copyed_name,demangled_name.data(),demangled_name.size());
2958 copyed_name[demangled_name.size()]='\0';
2959 return base_t{copyed_name,demangled_name.size()};
2960 #else
2961 //msvc
2962 //不需要复制重整结果
2963 return demangled_name;
2964 #endif
2965 }
2967 type_name_t(const char*original_name)noexcept:base_t(demangle(original_name)){}
2969 type_name_t(const type_name_t&other)noexcept:base_t(copy_demangle(other)){}
2971 type_name_t(type_name_t&&other)noexcept:base_t(nullptr,0){
2972 swap_with(other);
2973 }
2975 ~type_name_t()noexcept{
2976 #if defined(__clang__)||defined(__GNUC__)
2977 //gcc和clang
2978 //需要释放malloced的char*
2979 ::std::free((void*)begin());
2980 #endif
2981 }
2982 };
2983 [[nodiscard]]inline type_name_t base_type_info_t::get_name()const noexcept{
2984 return _tid.get_name();
2985 }
2986 [[nodiscard]]inline type_name_t base_type_info_t::type_id_t::get_name()const noexcept{
2987 return _m->name();
2988 }
2989 template<typename T>
2990 [[nodiscard]]inline type_name_t type_info_t<T>::get_name()const noexcept{
2991 return base_type_info_t(*this).get_name();
2992 }
2993
2994 //file_end
2995
2996 #line 33 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
2997 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/constexpr_str.hpp"
2998 //constexpr_str.hpp
2999 //at namespace elc::defs::base
3000 /*
3001 未完成的elc解释器base_defs文件
3002 由steve02081504与Alex0125设计、编写
3003 转载时请在不对此文件做任何修改的同时注明出处
3004 项目地址:https://github.com/steve02081504/ELC
3005 */
3006 namespace constexpr_str_n{
3007 //constexpr_str_t的退化类型,表明这是常量字符串,但没有可用的额外信息
3008 template<typename char_T>
3011 using base_t::base_t;
3012 constexpr_str_view_t(const char_T*str)noexcept=delete;
3013 //成员函数
3014 [[nodiscard]]constexpr const char_T*str()const noexcept{return base_t::cbegin();}
3015 [[nodiscard]]constexpr const char_T*data()const noexcept{return base_t::cbegin();}
3016 [[nodiscard]]constexpr operator const char_T*()const noexcept{return str();}
3017 //substr
3018 [[nodiscard]]constexpr constexpr_str_view_t substr(size_t pos,size_t len)const noexcept{
3019 return base_t::substr(pos,len);
3020 }
3021 [[nodiscard]]constexpr constexpr_str_view_t substr(size_t pos)const noexcept{
3022 return base_t::substr(pos);
3023 }
3024 [[nodiscard]]constexpr constexpr_str_view_t substr(size_t pos,const char_T*end)const noexcept{
3025 return base_t::substr(pos,end);
3026 }
3027 [[nodiscard]]constexpr constexpr_str_view_t substr(const char_T*begin,size_t len)const noexcept{
3028 return base_t::substr(begin,len);
3029 }
3030 [[nodiscard]]constexpr constexpr_str_view_t substr(const char_T*begin)const noexcept{
3031 return base_t::substr(begin);
3032 }
3033 [[nodiscard]]constexpr constexpr_str_view_t substr(const char_T*begin,const char_T*end)const noexcept{
3034 return base_t::substr(begin,end);
3035 }
3036 };
3037 //告知其他elc库接口这是编译时常量字符串,并提供编译时计算好的内容,包括但不限于hash、bmh头、bitmark等,用于加速库操作
3038 template<typename char_T>
3046 constexpr constexpr_str_t(const char_T* str, size_t size):
3047 base_t(str, size),
3048 hash_result(defs::hash(str, size)),
3049 match_pattern(array_like_view_t<const char_T>{str, size}),
3050 reverse_match_pattern(array_like_view_t<const char_T>{str, size}){
3051 is_bitmark_workable = bitmark_for_finds.mark(*this);
3052 }
3053 constexpr constexpr_str_t(const char_T* str):constexpr_str_t(str,array_end_by_zero_t::get_length_of(str)){}
3054 [[nodiscard]]constexpr hash_t hash()const noexcept{return hash_result;}
3055 };
3056 template<class char_T,size_t N>
3058 const char_T* _array_begin;
3059 constexpr constexpr_str_t_literal_helper(const char_T(&str)[N])noexcept{
3060 _array_begin=str;
3061 }
3062 [[nodiscard]]constexpr auto get_constexpr_str_t()const noexcept{
3063 return constexpr_str_t{_array_begin,N-1};
3064 }
3065 };
3066 template<constexpr_str_t_literal_helper v>
3068 distinctive static constexpr auto value = v.get_constexpr_str_t();
3069 };
3070 //别问,问就是傻逼c++
3071 //告知其他elc库接口这是编译时常量字符串,并提供编译时计算好的内容,包括但不限于hash、bmh头、bitmark等,用于加速库操作
3072 template<constexpr_str_t_literal_helper str_helper>
3073 [[nodiscard]]inline consteval auto& operator ""_constexpr_str()noexcept{
3075 }
3076 //空字串常量且str或begin会指向一个0终止字符串(而不是nullptr),便于安全初始化
3077 template<class char_T>
3078 distinctive inline constexpr auto empty_constexpr_str_of = constexpr_str_t(&const_default_value_of<char_T>,0);
3079 };
3083 using constexpr_str_n::operator ""_constexpr_str;
3084
3085 //重载range操作
3086 namespace range_n {
3087 template<typename T>
3088 [[nodiscard]]constexpr T* in_range(const constexpr_str_t<T>&pattern,array_like_view_t<T>range){
3089 return pattern.match_pattern.match(range);
3090 }
3091 template<typename T>
3092 [[nodiscard]]constexpr T* in_range_but_reverse(const constexpr_str_t<T>&pattern,array_like_view_t<T>range){
3093 return pattern.reverse_match_pattern.match(range);
3094 }
3095 //find_first_of
3096 //若成功找到匹配的数据项,返回其开头,若未找到,返回nullptr
3097 template<typename T>
3098 [[nodiscard]]constexpr T* find_first_of(const constexpr_str_t<T>&pattern,array_like_view_t<T>range){
3099 if(pattern.is_bitmark_workable){
3100 return find_first_of_bitmark(pattern.bitmark_for_finds,range);
3101 }
3102 else{
3103 return find_first_of((const constexpr_str_view_t<T>&)pattern,range);
3104 }
3105 }
3106 //find_last_of
3107 //若成功找到匹配的数据项,返回其开头,若未找到,返回nullptr
3108 template<typename T>
3109 [[nodiscard]]constexpr T* find_last_of(const constexpr_str_t<T>&pattern,array_like_view_t<T>range){
3110 if(pattern.is_bitmark_workable){
3111 return find_last_of_bitmark(pattern.bitmark_for_finds,range);
3112 }
3113 else{
3114 return find_last_of((const constexpr_str_view_t<T>&)pattern,range);
3115 }
3116 }
3117 //find_first_not_of
3118 //若成功找到不匹配的数据项,返回其开头,若未找到,返回nullptr
3119 template<typename T>
3120 [[nodiscard]]constexpr T* find_first_not_of(const constexpr_str_t<T>&pattern,array_like_view_t<T>range){
3121 if(pattern.is_bitmark_workable){
3122 return find_first_not_of_bitmark(pattern.bitmark_for_finds,range);
3123 }
3124 else{
3125 return find_first_not_of((const constexpr_str_view_t<T>&)pattern,range);
3126 }
3127 }
3128 //find_last_not_of
3129 //若成功找到不匹配的数据项,返回其开头,若未找到,返回nullptr
3130 template<typename T>
3131 [[nodiscard]]constexpr T* find_last_not_of(const constexpr_str_t<T>&pattern,array_like_view_t<T>range){
3132 if(pattern.is_bitmark_workable){
3133 return find_last_not_of_bitmark(pattern.bitmark_for_finds,range);
3134 }
3135 else{
3136 return find_last_not_of((const constexpr_str_view_t<T>&)pattern,range);
3137 }
3138 }
3139 };
3140
3141 //file_end
3142
3143 #line 34 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
3144 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/logical_bool.hpp"
3145 //logic.hpp
3146 //at namespace elc::defs::base
3147 /*
3148 未完成的elc解释器base_defs文件
3149 由steve02081504与Alex0125设计、编写
3150 转载时请在不对此文件做任何修改的同时注明出处
3151 项目地址:https://github.com/steve02081504/ELC
3152 */
3153
3164 /*
3165 在 虚伪 的 信 念 之 前 - 他 们 将 三 元 论 视 为 真理
3166 所 有 的 东西 都 是 三 部 分 。
3167 从 那里 , 他 们 终于 获得 了 答案 。
3168 */
3170 private:
3171 [[no_unique_address]]bool _is_true;
3172 [[no_unique_address]]bool _is_false;
3173 [[no_unique_address]]bool _is_unknown;
3174 public:
3175 constexpr logical_bool(special_init_t,bool is_true,bool is_false,bool is_unknown=0):_is_true(is_true),_is_false(is_false),_is_unknown(is_unknown){}
3176 constexpr logical_bool(bool a):_is_true(a),_is_false(!a),_is_unknown(0){}
3177 constexpr logical_bool(const logical_bool&)=default;
3178 constexpr logical_bool&operator=(const logical_bool&)& =default;
3179 constexpr explicit operator bool()const{return _is_true && !_is_unknown;}
3180 constexpr logical_bool operator!()const{
3181 logical_bool aret=*this;
3182 swap(aret._is_true,aret._is_false);
3183 return aret;
3184 }
3186 return logical_bool{special_init,a._is_true && b._is_true,a._is_false || b._is_false,a._is_unknown || b._is_unknown};
3187 }
3189 return logical_bool{special_init,a._is_true || b._is_true,a._is_false && b._is_false,a._is_unknown || b._is_unknown};
3190 }
3192 logical_bool aret(a._is_true == b._is_true && a._is_false == b._is_false);
3193 aret._is_unknown = a._is_unknown || b._is_unknown;
3194 return aret;
3195 }
3196 };
3198
3199 //file_end
3200
3201 #line 35 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
3202 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/zero.hpp"
3203 //zero.hpp
3204 //at namespace elc::defs::base
3205 /*
3206 未完成的elc解释器base_defs文件
3207 由steve02081504与Alex0125设计、编写
3208 转载时请在不对此文件做任何修改的同时注明出处
3209 项目地址:https://github.com/steve02081504/ELC
3210 */
3214 constexpr struct zero_t{
3215 template<class T> requires(type_info<decltype(0)>.can_convert_to<T>)
3216 operator T()const noexcept(type_info<decltype(0)>.can_nothrow_convert_to<T>){return 0;}
3218
3219 template<class T>
3220 constexpr inline bool is_all_byte_zero(T&&a){
3221 const byte*ptr=cast_to_data(addressof(a));
3222 const byte*end=ptr+sizeof(a);
3223 while(ptr!=end)
3224 if((unsigned char)(*ptr++))
3225 return false;
3226 return true;
3227 }
3228
3229 //file_end
3230
3231 #line 36 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
3232 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/count_able.hpp"
3233 //count_able.hpp
3234 //at namespace elc::defs::base
3235 /*
3236 未完成的elc解释器base_defs文件
3237 由steve02081504与Alex0125设计、编写
3238 转载时请在不对此文件做任何修改的同时注明出处
3239 项目地址:https://github.com/steve02081504/ELC
3240 */
3241 template<class T>
3242 [[nodiscard]]inline size_t the_number_of(type_info_t<T>)noexcept;
3243 template<class T>
3245 private:
3246 friend size_t the_number_of<T>(type_info_t<T>)noexcept;
3247 static size_t _number;
3248 public:
3249 count_able()noexcept{_number++;}
3250 ~count_able()noexcept{_number--;}
3251 };
3252 template<class T>
3253 [[nodiscard]]inline size_t the_number_of(type_info_t<T>)noexcept{
3254 if constexpr(type_info<T>.not_has_attribute(count_able))
3255 template_error("hey.");
3257 }
3258
3259 //file_end
3260
3261 #line 37 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
3262 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/invoke.hpp"
3263 //invoke.hpp
3264 //at namespace elc::defs::base
3265 /*
3266 未完成的elc解释器base_defs文件
3267 由steve02081504与Alex0125设计、编写
3268 转载时请在不对此文件做任何修改的同时注明出处
3269 项目地址:https://github.com/steve02081504/ELC
3270 */
3271 template<typename T>
3272 struct invoke_t{
3273 template<class...Args>
3274 static constexpr bool able= ::std::is_invocable_v<T,Args...>;
3275 template<class...Args>
3276 static constexpr bool nothrow= ::std::is_nothrow_invocable_v<T,Args...>;
3277
3278 template<class...Args> requires able<Args...>
3279 auto _as(Args&&...rest)const noexcept(nothrow<Args...>){//invoke<T>._as(...)
3280 return lambda_with_catch(rest...)(const T&a)noexcept(nothrow<Args...>){return a(forward<Args>(rest)...);};
3281 }
3282 };
3283 template<typename T>
3285
3286 //file_end
3287
3288 #line 38 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
3289 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/maybe_fail_reference.hpp"
3290 //maybe_fail_reference.hpp
3291 //at namespace elc::defs::base
3292 /*
3293 未完成的elc解释器base_defs文件
3294 由steve02081504与Alex0125设计、编写
3295 转载时请在不对此文件做任何修改的同时注明出处
3296 项目地址:https://github.com/steve02081504/ELC
3297 */
3298 template<typename T>
3300 T*_ref_to;
3301 public:
3302 constexpr maybe_fail_reference(T&a):_ref_to(&a){}
3304 constexpr maybe_fail_reference(note::fail_t):_ref_to(nullptr){}
3305
3306 [[nodiscard]]bool not_fail()noexcept{return _ref_to;}
3307 [[nodiscard]]bool fail()noexcept{return!not_fail();}
3308 T&get_ref()noexcept{return*_ref_to;}
3309 };
3310
3311 //file_end
3312
3313 #line 39 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
3314
3315 //file_end
3316
3317 #line 30 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/_body.hpp"
3318 }
3319
3320 //由于vcruntime的type_info在全局定义,这里需要额外声明使用base::type_info.
3321 #if defined(_VCRUNTIME_H)
3322 using base::type_info;
3323 #endif
3324
3325 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
3326 //_undefs.hpp
3327 /*
3328 未完成的elc解释器basic文件
3329 由steve02081504与Alex0125设计、编写
3330 转载时请在不对此文件做任何修改的同时注明出处
3331 项目地址:https://github.com/steve02081504/ELC
3332 */
3333 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_undefs.hpp"
3334 //_undefs.hpp
3335 /*
3336 未完成的elc解释器_share文件
3337 由steve02081504与Alex0125设计、编写
3338 转载时请在不对此文件做任何修改的同时注明出处
3339 项目地址:https://github.com/steve02081504/ELC
3340 */
3341
3342 //defs at "_defs.hpp"
3343
3344 #if defined(_MSC_VER)
3345 #pragma warning(pop)
3346 #endif
3347 #undef suppress_msvc_warning
3348 #undef disable_msvc_warning
3349 #undef push_msvc_warning
3350 #undef pop_msvc_warning
3351 #undef push_and_disable_msvc_warning
3352
3353 //for basic_environment.hpp
3354 #undef BIT_POSSIBILITY
3355 //
3356 #if defined(ELC_VOID_NAME)
3357 #define void the_void
3358 #endif
3359
3360 // #undef often_noexcept
3361 #undef noexcept_as
3362 #undef noexcept_as_auto
3363 #undef constexpr_as
3364 #undef constexpr_as_auto
3365
3366 #undef using_method_from_base_t
3367 #undef using_method_from_value
3368
3369 #undef floop
3370 #undef enable_adl
3371
3372 #undef re_declvalue
3373 #undef re_decltype
3374
3375 #undef declvalue
3376
3377 #undef template_error
3378 #undef template_warning
3379
3380 #undef type_info_of
3381 #undef type_name_of
3382
3383 #undef is_common_attribute
3384 #undef is_special_attribute
3385
3386 #undef has_attribute
3387 #undef not_has_attribute
3388
3389 #undef float_size_of
3390 #undef bitnum_of
3391
3392 #undef def_common_attribute_with_nothing
3393 #undef def_special_attribute_with_nothing
3394
3395 #undef common_attribute_t
3396 #undef special_attribute_t
3397
3398 #undef enable_if
3399 #undef enabled_by_default
3400 #undef disabled_by_default
3401 #undef enable_if_not_ill_form
3402 #undef enable_flag
3403
3404 #undef was_an_ill_form
3405 #undef was_an_ill_form_with_parameter
3406 #undef was_not_an_ill_form
3407 #undef was_not_an_ill_form_and_noexcept
3408 #undef was_not_an_ill_form_with_parameter
3409
3410 #undef recursive_lambda
3411 #undef get_recursive_lambda_caller
3412 #undef lambda
3413 #undef lambda_with_catch
3414 #undef self_recursion
3415 #undef lambda_RLSRRS
3416
3417 #undef MAGIC
3418
3419 #undef nothing
3420
3421 #undef elseif
3422 #undef _big_than_
3423 #undef _small_than_
3424
3425 #if defined(_MSC_VER)
3426 #undef not
3427 #undef and
3428 #undef or
3429 #endif
3430
3431 #undef INTER_NAMESPACE
3432 #undef BREAK_NAMESPACE
3433
3434 #undef szie
3435 #undef form
3436
3437 #undef template_name
3438 #undef type_name
3439
3440 #undef not_in_debug
3441
3442 #undef es
3443 #undef ec
3444
3445 #undef ELC_TEST_EVENTNAME
3446
3447 #undef override_instance_struct
3448
3449 #undef distinctive
3450
3451 #undef force_inline
3452
3453 #undef with_no_vtable
3454
3455 #undef in_consteval
3456
3457 #undef no_vtable_struct
3458 #undef no_vtable_class
3459
3460 //file_end
3461
3462 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
3463
3464 //file_end
3465
3466 #line 38 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/_body.hpp"
3467 }
3468
3469 //file_end
3470
3471 #line 21 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base_defs"
3472 #endif
3473
3474 //file_end
3475
3476 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base"
3477 #include <cstring>//memcpy、memmove
3478 #include <atomic>//atomic
3479 #if defined(ELC_TEST_ON)
3480 #include <ctime>//time
3481 #endif
3482 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/_body.hpp"
3483 //_body.hpp
3484 //at namespace ::
3485 /*
3486 未完成的elc解释器base文件
3487 由steve02081504与Alex0125设计、编写
3488 转载时请在不对此文件做任何修改的同时注明出处
3489 项目地址:https://github.com/steve02081504/ELC
3490 */
3491 #if defined(ELC_TEST)//若已包含elc/test则报错:其应在此文件后被包含
3492 #error "this part cannot be tested."
3493 #endif
3494
3495 //include APIs:elc中可能根据编译环境而修改的底层函数
3496 //using at memory/alloc
3497 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/alloc.hpp"
3498 //alloc.hpp
3499 /*
3500 未完成的elc解释器_share文件
3501 由steve02081504与Alex0125设计、编写
3502 转载时请在不对此文件做任何修改的同时注明出处
3503 项目地址:https://github.com/steve02081504/ELC
3504 */
3505 /*
3506 APIs说明
3507 elc依赖的基础函数.
3508 调整这些,实现快速移植,快速优化与行为自定义.
3509 */
3510 #if !defined(ELC_APIS_alloc)
3511 #define ELC_APIS_alloc
3512 #if defined(ELC_MEMORY_ALLOC_LOCATION_RECORD)
3513 #include <stacktrace>//for operate_source_location
3514 #endif
3515 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/_tools/decl_system_type.hpp"
3516 //decl_system_type.hpp
3517 /*
3518 未完成的elc解释器_share文件
3519 由steve02081504与Alex0125设计、编写
3520 转载时请在不对此文件做任何修改的同时注明出处
3521 项目地址:https://github.com/steve02081504/ELC
3522 */
3523 //copy&rewrite from steve02081504/steve.h
3524 #define linux 2
3525 #define windows 3
3526 #define other 4
3527 #if defined(__linux)||defined(__linux__)||defined(__gnu_linux__)
3528 #define SYSTEM_TYPE linux
3529 #elif defined(_WIN32)||defined(__MINGW32__)||defined(__CYGWIN__)
3530 #define SYSTEM_TYPE windows
3531 #else
3532 #define SYSTEM_TYPE other
3533 #endif
3534 #define ERROR_MSG_UNABLE_OS "Unable OS,edit this file on your own or contact ELC's producers."
3535
3536 //file_end
3537
3538 #line 18 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/alloc.hpp"
3539 #if SYSTEM_TYPE == windows
3540 #if defined(_DEBUG)
3541 #include <crtdbg.h>
3542 #else
3543 #include <malloc.h>
3544 #endif
3545 #else
3546 #include <cstdlib>
3547 #endif
3548 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base_defs"
3549 //base_defs
3550 //at namespace ::
3551 /*
3552 未完成的elc解释器include文件
3553 由steve02081504与Alex0125设计、编写
3554 转载时请在不对此文件做任何修改的同时注明出处
3555 项目地址:https://github.com/steve02081504/ELC
3556 */
3557 #line 22 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base_defs"
3558
3559 //file_end
3560
3561 #line 28 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/alloc.hpp"
3564 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
3565 //_defs.hpp
3566 /*
3567 未完成的elc解释器_share文件
3568 由steve02081504与Alex0125设计、编写
3569 转载时请在不对此文件做任何修改的同时注明出处
3570 项目地址:https://github.com/steve02081504/ELC
3571 */
3572
3573 //undefs at "_undefs.hpp"
3574
3575 //set ELC_WARNING_LEVEL default to 4(max)
3576 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
3577
3578 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/basic_environment.hpp"
3579 //basic_environment.hpp
3580 /*
3581 未完成的elc解释器_share文件
3582 由steve02081504与Alex0125设计、编写
3583 转载时请在不对此文件做任何修改的同时注明出处
3584 项目地址:https://github.com/steve02081504/ELC
3585 */
3586
3589 #define BIT_POSSIBILITY 2
3590
3591 //file_end
3592
3593 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
3594
3595 #if defined(_MSC_VER)
3596 #pragma warning(push,ELC_WARNING_LEVEL)
3597 #pragma warning(disable:4099)//class与struct混用警告diss
3598 #pragma warning(disable:26812)//enum class安利diss.
3599 #pragma warning(disable:4584)//重复子类警告diss
3600 #pragma warning(disable:4250)//域控制继承警告diss
3601 #pragma warning(disable:26432)//不完全默认方法警告diss
3602 #pragma warning(disable:26435)//virtual override方法警告diss
3603 #pragma warning(disable:26481)//容器安利diss
3604 #pragma warning(disable:26446)//gsl::at安利diss
3605 #pragma warning(disable:26434)//方法覆盖警告diss
3606 #pragma warning(disable:26429)//gsl::not_null安利diss
3607 #pragma warning(disable:26471)//对void*进行static_cast安利diss
3608 #pragma warning(disable:26474)//隐式指针转换显式cast警告diss
3609 #pragma warning(disable:26473)//相同指针显式cast警告diss
3610 #pragma warning(disable:26456)//隐藏非虚运算符警告diss
3611 #pragma warning(disable:26485)//数组作指针警告diss
3612 #pragma warning(disable:26490)//reinterpret_cast警告diss
3613 #pragma warning(disable:26472)//static_cast窄幅转换警告diss
3614 #pragma warning(disable:26482)//非常数数组索引警告diss
3615 #pragma warning(disable:26493)//c_cast转换警告diss:虽然有用但是太烦了,爬
3616 #endif
3617 #if defined(_MSC_VER)
3618 #define suppress_msvc_warning(...) __pragma(warning(suppress:__VA_ARGS__))
3619 #define disable_msvc_warning(...) __pragma(warning(disable:__VA_ARGS__))
3620 #define push_msvc_warning() __pragma(warning(push))
3621 #define pop_msvc_warning() __pragma(warning(pop))
3622 #define push_and_disable_msvc_warning(...) push_msvc_warning() disable_msvc_warning(__VA_ARGS__)
3623 #else
3624 #define suppress_msvc_warning(...)
3625 #define disable_msvc_warning(...)
3626 #define push_msvc_warning()
3627 #define pop_msvc_warning()
3628 #define push_and_disable_msvc_warning(...)
3629 #endif
3630 //
3631 #if defined(ELC_VOID_NAME)
3632 #undef void
3633 #endif
3634
3635 // #define often_noexcept
3636 #define noexcept_as(...) noexcept(noexcept((__VA_ARGS__)))//dnmd C艹标准就是没有noexcept_as_auto
3637 #define noexcept_as_auto MAGIC//哦现在有了
3638 #define constexpr_as(...) MAGIC constexpr//( •̀ ω •́ )✌
3639 #define constexpr_as_auto MAGIC MAGIC constexpr//✌( •̀ ω •́ )✌
3640
3641 #define using_method_from_base_t(name,...) \
3642 template<class...Args> requires was_not_an_ill_form(declvalue(base_t).name(declvalue(Args)...))\
3643 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(base_t::name(declvalue(Args)...))\
3644 {\
3645 return base_t::name(forward<Args>(rest)...);\
3646 }\
3647
3648 #define using_method_from_value(name,value_name,...) \
3649 template<class...Args> requires was_not_an_ill_form(re_declvalue(value_name).name(declvalue(Args)...))\
3650 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(re_declvalue(value_name).name(declvalue(Args)...))\
3651 {\
3652 return value_name.name(forward<Args>(rest)...);\
3653 }\
3654
3655 #define floop while(__builtin_is_my_dick_still_there())
3656 #define enable_adl(name) void name()noexcept=delete
3657
3658 #define re_declvalue(...) (declvalue(decltype(__VA_ARGS__)))
3659 #define re_decltype(...) (decltype(declvalue(__VA_ARGS__)))
3660
3661 #define declvalue(...) (::std::declval<__VA_ARGS__>())
3662
3664 #define template_error(reason) static_assert(template_error_helper<T>,reason)
3666 #define template_warning(reason) template_warning_helper<T>(reason)
3667
3668 //for type_info
3669 #define type_info_of(...) base_type_info_t(typeid(__VA_ARGS__))
3670 #define type_name_of(...) (type_info_of(__VA_ARGS__).name())
3671
3672 #define is_common_attribute(name) public attribute<T,name<T>>
3673 #define is_special_attribute(name) public attribute<T,name>
3674
3675 #define has_attribute(...) template_name has_attribute_helper<__VA_ARGS__>()
3676 #define not_has_attribute(...) template_name not_has_has_attribute_helper<__VA_ARGS__>()
3677
3678 //for float_size_t
3679 #define float_size_of(...) (float_size_t{sizeof(__VA_ARGS__)})
3680 //bitnum_of
3681 #define bitnum_of(...) (bitnumof<__VA_ARGS__>)
3682
3683 //for attribute
3684 #define def_common_attribute_with_nothing(name) \
3685 template<typename T>\
3686 class name{}\
3687
3688 #define def_special_attribute_with_nothing(name) \
3689 class name{}\
3690
3691 #define common_attribute_t template<class>class
3692 #define special_attribute_t class
3693
3702 #define enable_if(...) class enable_state= ::std::enable_if_t<__VA_ARGS__>
3704 #define enabled_by_default class enable_state=void
3706 #define disabled_by_default class enable_state= ::std::enable_if_t<false>
3708 #define enable_if_not_ill_form(...) class enable_state= ::std::void_t<decltype(__VA_ARGS__)>
3710 #define enable_flag class enable_state
3711
3712 #define was_an_ill_form(...) (!was_not_an_ill_form(__VA_ARGS__))
3713 #define was_an_ill_form_with_parameter(...) (!was_not_an_ill_form_with_parameter(__VA_ARGS__))
3714 #define was_not_an_ill_form(...) (bool(requires{__VA_ARGS__;}))
3715 #define was_not_an_ill_form_and_noexcept(...) (bool(requires{__VA_ARGS__;{__VA_ARGS__}noexcept;}))
3716 #define was_not_an_ill_form_with_parameter(...) (bool(requires __VA_ARGS__ ))
3717
3719 #define recursive_lambda(...) lambda(auto&&lambda_RLSRRS,__VA_ARGS__)
3721 #define get_recursive_lambda_caller(name) \
3722 lambda_with_catch(&)(auto&&...Args){\
3723 return name(name,Args...);\
3724 }
3726 #define lambda []
3728 #define lambda_with_catch(...) [__VA_ARGS__]
3730 #define self_recursion(...) lambda_RLSRRS(lambda_RLSRRS,__VA_ARGS__)
3731 //recursive_lambda_self_referential_reserved_symbolname
3732 #define lambda_RLSRRS _my_jb_super_sb_name_
3733
3734 #define MAGIC//ahh,ko no tenno da!
3735
3737 #define nothing
3738
3740 #define elseif else if
3742 #define _big_than_ >
3744 #define _small_than_ <
3745
3746 #if defined(_MSC_VER)
3747 #define not !
3748 #define and &&
3749 #define or ||
3750 #endif
3751
3753 #define INTER_NAMESPACE(NAMESPACENAME) namespace NAMESPACENAME{
3755 #define BREAK_NAMESPACE }
3756
3758 #define template_name template
3760 #define type_name class
3761
3762 #if defined(DEBUG) || defined(_DEBUG)
3763 #define not_in_debug 0
3764 #else
3765 #define not_in_debug 1
3766 #endif
3767
3768 #define es U""
3769 #define ec(ch) U ## ch
3770
3771 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
3772 #define ELC_TEST_EVENTNAME(name) stest_eventer _the_stest_eventer__(L""name)
3773 #else
3774 #define ELC_TEST_EVENTNAME(name)
3775 #endif
3776
3777 #define override_instance_struct \
3778 protected:\
3779 virtual void abstract_method_unget_this()noexcept_as(instance_struct<this_t>::abstract_method_unget_this())override{instance_struct<this_t>::abstract_method_unget_this();}\
3780 virtual void* _abstract_method_copy_get_this()noexcept_as(instance_struct<this_t>::_abstract_method_copy_get_this())override{return instance_struct<this_t>::_abstract_method_copy_get_this();}\
3781 virtual void* _abstract_method_get_resize_this(size_t size)noexcept_as(instance_struct<this_t>::instance_struct<this_t>::_abstract_method_get_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_resize_this(size);}\
3782 virtual void* _abstract_method_get_forward_resize_this(size_t size)noexcept_as(instance_struct<this_t>::_abstract_method_get_forward_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_forward_resize_this(size);}\
3783 virtual size_t abstract_method_get_size_of_get_for_this()noexcept override{return instance_struct<this_t>::abstract_method_get_size_of_get_for_this();}
3784
3785 #if defined(_WIN32)
3786 #define distinctive __declspec(dllexport)
3787 #else
3788 #define distinctive
3789 #endif
3790
3791 #if defined(_WIN32)
3792 #define force_inline __forceinline
3793 #elif defined(__GNUC__)
3794 #define force_inline __attribute__((always_inline)) inline
3795 #else
3796 #define force_inline inline
3797 #endif
3798
3799 #if defined(_WIN32)
3800 #define with_no_vtable __declspec(novtable)
3801 #else
3802 #define with_no_vtable
3803 #endif
3804
3805 #define in_consteval (::std::is_constant_evaluated())
3806
3807 #define no_vtable_struct struct with_no_vtable
3808 #define no_vtable_class class with_no_vtable
3809
3810 //file_end
3811
3812 #line 31 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/alloc.hpp"
3813
3814 using namespace ::elc::defs;//remove_const||byte
3815 #if SYSTEM_TYPE != windows
3816 //overhead
3817 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/alloc/default_method/overhead.hpp"
3818 //overhead.hpp
3819 //at namespace elc::APIs::alloc
3820 /*
3821 未完成的elc解释器base文件
3822 由steve02081504与Alex0125设计、编写
3823 转载时请在不对此文件做任何修改的同时注明出处
3824 项目地址:https://github.com/steve02081504/ELC
3825 */
3826 namespace overhead_n{
3827 using namespace ::elc::defs;
3828 constexpr size_t overhead_get_align(size_t align){
3829 return max(align,alignof(size_t));//保证最高对齐需求
3830 }
3831 constexpr size_t overhead_get_offset_value(size_t align){
3832 align=overhead_get_align(align);
3833 return (size_t(sizeof(size_t)/align)+bool(sizeof(size_t)%align))*align;//等同于sizeof(size_t)-sizeof(size_t)%align+(sizeof(size_t)%align?align:0)
3834 //暨,偏移量既要大于sizeof(size_t)以装下overhead,又要是align的整数倍以保证T实例的对齐被满足
3835 }
3836 constexpr size_t correct_size(size_t size,size_t align){
3837 return size+overhead_get_offset_value(align);
3838 }
3839 constexpr size_t correct_align(size_t align){
3840 return overhead_get_align(align);
3841 }
3842 inline pointer correct_pointer(pointer a,size_t align){
3843 return apply_off_set(a,overhead_get_offset_value(align));
3844 }
3845 inline pointer recorrect_pointer(pointer a,size_t align){
3846 return unapply_off_set(a,overhead_get_offset_value(align));
3847 }
3848 inline const_pointer recorrect_pointer(const_pointer a, size_t align){
3849 return unapply_off_set(a,overhead_get_offset_value(align));
3850 }
3851 inline void set_overhead(pointer a,size_t size){
3852 *reinterpret_cast<size_t*>(a)=size;
3853 }
3854 inline size_t get_overhead(const_pointer a){
3855 return*reinterpret_cast<const size_t*>(a);
3856 }
3857 }
3858
3859 //file_end
3860
3861 #line 35 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/alloc.hpp"
3862 #endif
3863 //operate_source_location & source_location_guard
3864 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/alloc/debug_info/source_location_guard.hpp"
3865 //source_location_guard.hpp
3866 //at namespace elc::APIs::alloc
3867 /*
3868 未完成的elc解释器base文件
3869 由steve02081504与Alex0125设计、编写
3870 转载时请在不对此文件做任何修改的同时注明出处
3871 项目地址:https://github.com/steve02081504/ELC
3872 */
3873 #if defined(_MSC_VER)
3874 #if defined(ELC_MEMORY_ALLOC_LOCATION_RECORD)
3875 #pragma detect_mismatch("ELC_MEMORY_ALLOC_LOCATION_RECORD","true")
3876 #else
3877 #pragma detect_mismatch("ELC_MEMORY_ALLOC_LOCATION_RECORD","false")
3878 #endif
3879 #endif
3880 #if defined(ELC_MEMORY_ALLOC_LOCATION_RECORD)
3881 distinctive inline ::std::stacktrace_entry operate_source_frame;
3882 distinctive inline struct source_location_info_t{
3883 const char*_file=nullptr;
3884 uint_least32_t _line=0;
3885 const char*file()noexcept{
3886 if(!_file){
3887 try{
3888 static ::std::string file_cache;
3889 file_cache=operate_source_frame.source_file();
3890 _file=file_cache.c_str();
3891 }
3892 catch(...){
3893 }
3894 }
3895 return _file;
3896 }
3897 uint_least32_t line()noexcept{
3898 if(!_line){
3899 try{
3900 _line=operate_source_frame.source_line();
3901 }
3902 catch(...){
3903 }
3904 }
3905 return _line;
3906 }
3907 void clear()noexcept{
3908 _file=nullptr;
3909 _line=0;
3910 }
3912 struct source_location_guard{
3913 bool _is_set=false;
3914 source_location_guard(size_t lookup=0)noexcept{
3915 if(!operate_source_frame){
3916 ::std::stacktrace stack = ::std::stacktrace::current(/*skip*/lookup+2,/*max_depth*/1);
3917 if(stack.size()){
3918 operate_source_frame = stack[0];
3919 _is_set = true;
3920 }
3921 }
3922 }
3923 ~source_location_guard()noexcept{
3924 if(_is_set){
3925 operate_source_frame = ::std::stacktrace_entry{};
3927 }
3928 }
3929 };
3930 #else
3932 constexpr source_location_guard([[maybe_unused]]size_t lookup=0)noexcept{}
3933 };
3935 constexpr const char*file()noexcept{return nullptr;}
3936 constexpr uint_least32_t line()noexcept{return 0;}
3937 }operate_source_location;
3938 #endif
3939
3940 //file_end
3941
3942 #line 37 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/alloc.hpp"
3943
3944 //BLOCK: Counting memory allocations
3945 #if defined(_MSC_VER)
3946 #if defined(ELC_TEST_COUNT_MEMORY_ALLOC)
3947 #pragma detect_mismatch("ELC_TEST_COUNT_MEMORY_ALLOC","true")
3948 #else
3949 #pragma detect_mismatch("ELC_TEST_COUNT_MEMORY_ALLOC","false")
3950 #endif
3951 #endif
3952
3953 #if defined(ELC_TEST_COUNT_MEMORY_ALLOC)
3954 [[nodiscard]]inline size_t get_size_of_alloc(const byte*p,size_t align)noexcept;
3955 namespace count_info{
3956 distinctive inline size_t alloc_count=0;
3957 distinctive inline size_t free_count=0;
3958 distinctive inline size_t alloc_size=0;
3959 distinctive inline size_t free_size=0;
3960 distinctive inline size_t memory_using=0;
3961 distinctive inline size_t memory_using_max=0;
3962 inline void update_memory_using(ptrdiff_t diff)noexcept{
3963 memory_using+=diff;
3964 if(memory_using>memory_using_max)
3965 memory_using_max=memory_using;
3966 }
3967 inline void clear()noexcept{
3968 alloc_count=0;
3969 free_count=0;
3970 alloc_size=0;
3971 free_size=0;
3972 memory_using=0;
3973 memory_using_max=0;
3974 }
3975 }
3976 #endif
3977 //BLOCK_END
3978
3984 [[nodiscard]]inline byte*aligned_alloc(size_t align,size_t size)noexcept{
3985 void* aret;//返回值放这里
3986
3987 #if SYSTEM_TYPE == windows
3988 #if defined(_DEBUG)
3989 aret = _aligned_malloc_dbg(size,align,operate_source_location.file(),operate_source_location.line());
3990 #else
3991 aret = _aligned_malloc(size,align);
3992 #endif
3993 #else
3994 using namespace overhead_n;
3995 void*tmp=::std::aligned_alloc(correct_align(align),correct_size(size,align));
3996 if(tmp){
3997 set_overhead(tmp,size);
3998 aret = correct_pointer(tmp,align);
3999 }
4000 else
4001 aret = nullptr;
4002 #endif
4003
4004 #if defined(ELC_TEST_COUNT_MEMORY_ALLOC)
4005 if(aret){
4006 count_info::alloc_count++;
4007 count_info::alloc_size+=size;
4008 count_info::update_memory_using(size);
4009 }
4010 #endif
4011
4012 return(byte*)aret;
4013 }
4021 [[nodiscard]]inline byte*realloc(byte*ptr,size_t nsize,[[maybe_unused]]size_t align)noexcept{
4022 #if defined(ELC_TEST_COUNT_MEMORY_ALLOC)
4023 const auto osize=get_size_of_alloc(ptr,align);
4024 #endif
4025 void* aret;//返回值放这里
4026
4027 #if SYSTEM_TYPE == windows
4028 #if defined(_DEBUG)
4029 aret = _aligned_realloc_dbg(ptr,nsize,align,operate_source_location.file(),operate_source_location.line());
4030 #else
4031 aret = _aligned_realloc(ptr,nsize,align);
4032 #endif
4033 #else
4034 using namespace overhead_n;
4035 void*tmp=::std::realloc(recorrect_pointer(ptr,align),correct_size(nsize,align));
4036 if(tmp){
4037 set_overhead(tmp,nsize);
4038 aret = correct_pointer(tmp,align);
4039 }
4040 else
4041 aret = nullptr;
4042 #endif
4043
4044 #if defined(ELC_TEST_COUNT_MEMORY_ALLOC)
4045 if(aret){
4046 count_info::alloc_size+=nsize-osize;
4047 count_info::update_memory_using(nsize-osize);
4048 }
4049 #endif
4050
4051 return(byte*)aret;
4052 }
4057 inline void free(byte*p,[[maybe_unused]]size_t align)noexcept{
4058 #if defined(ELC_TEST_COUNT_MEMORY_ALLOC)
4059 const auto size=get_size_of_alloc(p,align);
4060 count_info::free_count++;
4061 count_info::free_size+=size;
4062 count_info::update_memory_using(-ptrdiff_t(size));
4063 #endif
4064
4065 #if SYSTEM_TYPE == windows
4066 #if defined(_DEBUG)
4067 _aligned_free_dbg(p);
4068 #else
4069 _aligned_free(p);
4070 #endif
4071 #else
4072 using namespace overhead_n;
4073 ::std::free(recorrect_pointer(p,align));
4074 #endif
4075 }
4080 [[nodiscard]]inline size_t get_size_of_alloc(const byte*p,[[maybe_unused]]size_t align)noexcept{
4081 #if SYSTEM_TYPE == windows
4082 #if defined(_DEBUG)
4083 return _aligned_msize_dbg(remove_const(p),align,0);
4084 #else
4085 return _aligned_msize(remove_const(p),align,0);
4086 #endif
4087 #else
4088 using namespace overhead_n;
4089 return get_overhead(recorrect_pointer(p,align));
4090 #endif
4091 }
4092
4093 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_undefs.hpp"
4094 //_undefs.hpp
4095 /*
4096 未完成的elc解释器_share文件
4097 由steve02081504与Alex0125设计、编写
4098 转载时请在不对此文件做任何修改的同时注明出处
4099 项目地址:https://github.com/steve02081504/ELC
4100 */
4101
4102 //defs at "_defs.hpp"
4103
4104 #if defined(_MSC_VER)
4105 #pragma warning(pop)
4106 #endif
4107 #undef suppress_msvc_warning
4108 #undef disable_msvc_warning
4109 #undef push_msvc_warning
4110 #undef pop_msvc_warning
4111 #undef push_and_disable_msvc_warning
4112
4113 //for basic_environment.hpp
4114 #undef BIT_POSSIBILITY
4115 //
4116 #if defined(ELC_VOID_NAME)
4117 #define void the_void
4118 #endif
4119
4120 // #undef often_noexcept
4121 #undef noexcept_as
4122 #undef noexcept_as_auto
4123 #undef constexpr_as
4124 #undef constexpr_as_auto
4125
4126 #undef using_method_from_base_t
4127 #undef using_method_from_value
4128
4129 #undef floop
4130 #undef enable_adl
4131
4132 #undef re_declvalue
4133 #undef re_decltype
4134
4135 #undef declvalue
4136
4137 #undef template_error
4138 #undef template_warning
4139
4140 #undef type_info_of
4141 #undef type_name_of
4142
4143 #undef is_common_attribute
4144 #undef is_special_attribute
4145
4146 #undef has_attribute
4147 #undef not_has_attribute
4148
4149 #undef float_size_of
4150 #undef bitnum_of
4151
4152 #undef def_common_attribute_with_nothing
4153 #undef def_special_attribute_with_nothing
4154
4155 #undef common_attribute_t
4156 #undef special_attribute_t
4157
4158 #undef enable_if
4159 #undef enabled_by_default
4160 #undef disabled_by_default
4161 #undef enable_if_not_ill_form
4162 #undef enable_flag
4163
4164 #undef was_an_ill_form
4165 #undef was_an_ill_form_with_parameter
4166 #undef was_not_an_ill_form
4167 #undef was_not_an_ill_form_and_noexcept
4168 #undef was_not_an_ill_form_with_parameter
4169
4170 #undef recursive_lambda
4171 #undef get_recursive_lambda_caller
4172 #undef lambda
4173 #undef lambda_with_catch
4174 #undef self_recursion
4175 #undef lambda_RLSRRS
4176
4177 #undef MAGIC
4178
4179 #undef nothing
4180
4181 #undef elseif
4182 #undef _big_than_
4183 #undef _small_than_
4184
4185 #if defined(_MSC_VER)
4186 #undef not
4187 #undef and
4188 #undef or
4189 #endif
4190
4191 #undef INTER_NAMESPACE
4192 #undef BREAK_NAMESPACE
4193
4194 #undef szie
4195 #undef form
4196
4197 #undef template_name
4198 #undef type_name
4199
4200 #undef not_in_debug
4201
4202 #undef es
4203 #undef ec
4204
4205 #undef ELC_TEST_EVENTNAME
4206
4207 #undef override_instance_struct
4208
4209 #undef distinctive
4210
4211 #undef force_inline
4212
4213 #undef with_no_vtable
4214
4215 #undef in_consteval
4216
4217 #undef no_vtable_struct
4218 #undef no_vtable_class
4219
4220 //file_end
4221
4222 #line 188 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/alloc.hpp"
4223 }
4224 //
4225 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/_tools/undef_decl_system_type.hpp"
4226 //undef_decl_system_type.hpp
4227 /*
4228 未完成的elc解释器_share文件
4229 由steve02081504与Alex0125设计、编写
4230 转载时请在不对此文件做任何修改的同时注明出处
4231 项目地址:https://github.com/steve02081504/ELC
4232 */
4233 //copy&rewrite from steve02081504/evest.h
4234 #undef linux
4235 #undef windows
4236 #undef other
4237 #undef SYSTEM_TYPE
4238 #undef ERROR_MSG_UNABLE_OS
4239
4240 //file_end
4241
4242 #line 191 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/alloc.hpp"
4243 #endif
4244
4245 //file_end
4246
4247 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/_body.hpp"
4248 //using at memory/gc
4249 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/die.hpp"
4250 //die.hpp
4251 /*
4252 未完成的elc解释器_share文件
4253 由steve02081504与Alex0125设计、编写
4254 转载时请在不对此文件做任何修改的同时注明出处
4255 项目地址:https://github.com/steve02081504/ELC
4256 */
4257 /*
4258 APIs说明
4259 elc依赖的基础函数.
4260 调整这些,实现快速移植,快速优化与行为自定义.
4261 */
4262 #if !defined(ELC_APIS_die)
4263 #define ELC_APIS_die
4264 #include <cuchar>
4265 #include <clocale>
4266 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/default_data_type.hpp"
4267 //default_data_type.hpp
4268 /*
4269 未完成的elc解释器_share文件
4270 由steve02081504与Alex0125设计、编写
4271 转载时请在不对此文件做任何修改的同时注明出处
4272 项目地址:https://github.com/steve02081504/ELC
4273 */
4274 namespace elc{
4275 /*ELC内部string统一采用char_t宽字符,使用setlocale(LC_ALL,"en_US.utf8")下的UTF编码。*/
4276 typedef char32_t char_t;
4277 /*ELC内部钦定int_t类型*/
4278 typedef int64_t int_t;
4279 /*ELC内部钦定uint_t类型*/
4280 typedef uint64_t uint_t;
4281 /*ELC内部钦定float_t类型*/
4282 typedef double float_t;
4283 /*ELC内部钦定float_size_t类型,用以描述内存大小的浮点状况*/
4284 typedef long double float_size_t;
4285 }
4286
4287 //file_end
4288
4289 #line 17 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/die.hpp"
4292 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
4293 //_defs.hpp
4294 /*
4295 未完成的elc解释器_share文件
4296 由steve02081504与Alex0125设计、编写
4297 转载时请在不对此文件做任何修改的同时注明出处
4298 项目地址:https://github.com/steve02081504/ELC
4299 */
4300
4301 //undefs at "_undefs.hpp"
4302
4303 //set ELC_WARNING_LEVEL default to 4(max)
4304 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
4305
4306 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/basic_environment.hpp"
4307 //basic_environment.hpp
4308 /*
4309 未完成的elc解释器_share文件
4310 由steve02081504与Alex0125设计、编写
4311 转载时请在不对此文件做任何修改的同时注明出处
4312 项目地址:https://github.com/steve02081504/ELC
4313 */
4314
4317 #define BIT_POSSIBILITY 2
4318
4319 //file_end
4320
4321 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
4322
4323 #if defined(_MSC_VER)
4324 #pragma warning(push,ELC_WARNING_LEVEL)
4325 #pragma warning(disable:4099)//class与struct混用警告diss
4326 #pragma warning(disable:26812)//enum class安利diss.
4327 #pragma warning(disable:4584)//重复子类警告diss
4328 #pragma warning(disable:4250)//域控制继承警告diss
4329 #pragma warning(disable:26432)//不完全默认方法警告diss
4330 #pragma warning(disable:26435)//virtual override方法警告diss
4331 #pragma warning(disable:26481)//容器安利diss
4332 #pragma warning(disable:26446)//gsl::at安利diss
4333 #pragma warning(disable:26434)//方法覆盖警告diss
4334 #pragma warning(disable:26429)//gsl::not_null安利diss
4335 #pragma warning(disable:26471)//对void*进行static_cast安利diss
4336 #pragma warning(disable:26474)//隐式指针转换显式cast警告diss
4337 #pragma warning(disable:26473)//相同指针显式cast警告diss
4338 #pragma warning(disable:26456)//隐藏非虚运算符警告diss
4339 #pragma warning(disable:26485)//数组作指针警告diss
4340 #pragma warning(disable:26490)//reinterpret_cast警告diss
4341 #pragma warning(disable:26472)//static_cast窄幅转换警告diss
4342 #pragma warning(disable:26482)//非常数数组索引警告diss
4343 #pragma warning(disable:26493)//c_cast转换警告diss:虽然有用但是太烦了,爬
4344 #endif
4345 #if defined(_MSC_VER)
4346 #define suppress_msvc_warning(...) __pragma(warning(suppress:__VA_ARGS__))
4347 #define disable_msvc_warning(...) __pragma(warning(disable:__VA_ARGS__))
4348 #define push_msvc_warning() __pragma(warning(push))
4349 #define pop_msvc_warning() __pragma(warning(pop))
4350 #define push_and_disable_msvc_warning(...) push_msvc_warning() disable_msvc_warning(__VA_ARGS__)
4351 #else
4352 #define suppress_msvc_warning(...)
4353 #define disable_msvc_warning(...)
4354 #define push_msvc_warning()
4355 #define pop_msvc_warning()
4356 #define push_and_disable_msvc_warning(...)
4357 #endif
4358 //
4359 #if defined(ELC_VOID_NAME)
4360 #undef void
4361 #endif
4362
4363 // #define often_noexcept
4364 #define noexcept_as(...) noexcept(noexcept((__VA_ARGS__)))//dnmd C艹标准就是没有noexcept_as_auto
4365 #define noexcept_as_auto MAGIC//哦现在有了
4366 #define constexpr_as(...) MAGIC constexpr//( •̀ ω •́ )✌
4367 #define constexpr_as_auto MAGIC MAGIC constexpr//✌( •̀ ω •́ )✌
4368
4369 #define using_method_from_base_t(name,...) \
4370 template<class...Args> requires was_not_an_ill_form(declvalue(base_t).name(declvalue(Args)...))\
4371 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(base_t::name(declvalue(Args)...))\
4372 {\
4373 return base_t::name(forward<Args>(rest)...);\
4374 }\
4375
4376 #define using_method_from_value(name,value_name,...) \
4377 template<class...Args> requires was_not_an_ill_form(re_declvalue(value_name).name(declvalue(Args)...))\
4378 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(re_declvalue(value_name).name(declvalue(Args)...))\
4379 {\
4380 return value_name.name(forward<Args>(rest)...);\
4381 }\
4382
4383 #define floop while(__builtin_is_my_dick_still_there())
4384 #define enable_adl(name) void name()noexcept=delete
4385
4386 #define re_declvalue(...) (declvalue(decltype(__VA_ARGS__)))
4387 #define re_decltype(...) (decltype(declvalue(__VA_ARGS__)))
4388
4389 #define declvalue(...) (::std::declval<__VA_ARGS__>())
4390
4392 #define template_error(reason) static_assert(template_error_helper<T>,reason)
4394 #define template_warning(reason) template_warning_helper<T>(reason)
4395
4396 //for type_info
4397 #define type_info_of(...) base_type_info_t(typeid(__VA_ARGS__))
4398 #define type_name_of(...) (type_info_of(__VA_ARGS__).name())
4399
4400 #define is_common_attribute(name) public attribute<T,name<T>>
4401 #define is_special_attribute(name) public attribute<T,name>
4402
4403 #define has_attribute(...) template_name has_attribute_helper<__VA_ARGS__>()
4404 #define not_has_attribute(...) template_name not_has_has_attribute_helper<__VA_ARGS__>()
4405
4406 //for float_size_t
4407 #define float_size_of(...) (float_size_t{sizeof(__VA_ARGS__)})
4408 //bitnum_of
4409 #define bitnum_of(...) (bitnumof<__VA_ARGS__>)
4410
4411 //for attribute
4412 #define def_common_attribute_with_nothing(name) \
4413 template<typename T>\
4414 class name{}\
4415
4416 #define def_special_attribute_with_nothing(name) \
4417 class name{}\
4418
4419 #define common_attribute_t template<class>class
4420 #define special_attribute_t class
4421
4430 #define enable_if(...) class enable_state= ::std::enable_if_t<__VA_ARGS__>
4432 #define enabled_by_default class enable_state=void
4434 #define disabled_by_default class enable_state= ::std::enable_if_t<false>
4436 #define enable_if_not_ill_form(...) class enable_state= ::std::void_t<decltype(__VA_ARGS__)>
4438 #define enable_flag class enable_state
4439
4440 #define was_an_ill_form(...) (!was_not_an_ill_form(__VA_ARGS__))
4441 #define was_an_ill_form_with_parameter(...) (!was_not_an_ill_form_with_parameter(__VA_ARGS__))
4442 #define was_not_an_ill_form(...) (bool(requires{__VA_ARGS__;}))
4443 #define was_not_an_ill_form_and_noexcept(...) (bool(requires{__VA_ARGS__;{__VA_ARGS__}noexcept;}))
4444 #define was_not_an_ill_form_with_parameter(...) (bool(requires __VA_ARGS__ ))
4445
4447 #define recursive_lambda(...) lambda(auto&&lambda_RLSRRS,__VA_ARGS__)
4449 #define get_recursive_lambda_caller(name) \
4450 lambda_with_catch(&)(auto&&...Args){\
4451 return name(name,Args...);\
4452 }
4454 #define lambda []
4456 #define lambda_with_catch(...) [__VA_ARGS__]
4458 #define self_recursion(...) lambda_RLSRRS(lambda_RLSRRS,__VA_ARGS__)
4459 //recursive_lambda_self_referential_reserved_symbolname
4460 #define lambda_RLSRRS _my_jb_super_sb_name_
4461
4462 #define MAGIC//ahh,ko no tenno da!
4463
4465 #define nothing
4466
4468 #define elseif else if
4470 #define _big_than_ >
4472 #define _small_than_ <
4473
4474 #if defined(_MSC_VER)
4475 #define not !
4476 #define and &&
4477 #define or ||
4478 #endif
4479
4481 #define INTER_NAMESPACE(NAMESPACENAME) namespace NAMESPACENAME{
4483 #define BREAK_NAMESPACE }
4484
4486 #define template_name template
4488 #define type_name class
4489
4490 #if defined(DEBUG) || defined(_DEBUG)
4491 #define not_in_debug 0
4492 #else
4493 #define not_in_debug 1
4494 #endif
4495
4496 #define es U""
4497 #define ec(ch) U ## ch
4498
4499 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
4500 #define ELC_TEST_EVENTNAME(name) stest_eventer _the_stest_eventer__(L""name)
4501 #else
4502 #define ELC_TEST_EVENTNAME(name)
4503 #endif
4504
4505 #define override_instance_struct \
4506 protected:\
4507 virtual void abstract_method_unget_this()noexcept_as(instance_struct<this_t>::abstract_method_unget_this())override{instance_struct<this_t>::abstract_method_unget_this();}\
4508 virtual void* _abstract_method_copy_get_this()noexcept_as(instance_struct<this_t>::_abstract_method_copy_get_this())override{return instance_struct<this_t>::_abstract_method_copy_get_this();}\
4509 virtual void* _abstract_method_get_resize_this(size_t size)noexcept_as(instance_struct<this_t>::instance_struct<this_t>::_abstract_method_get_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_resize_this(size);}\
4510 virtual void* _abstract_method_get_forward_resize_this(size_t size)noexcept_as(instance_struct<this_t>::_abstract_method_get_forward_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_forward_resize_this(size);}\
4511 virtual size_t abstract_method_get_size_of_get_for_this()noexcept override{return instance_struct<this_t>::abstract_method_get_size_of_get_for_this();}
4512
4513 #if defined(_WIN32)
4514 #define distinctive __declspec(dllexport)
4515 #else
4516 #define distinctive
4517 #endif
4518
4519 #if defined(_WIN32)
4520 #define force_inline __forceinline
4521 #elif defined(__GNUC__)
4522 #define force_inline __attribute__((always_inline)) inline
4523 #else
4524 #define force_inline inline
4525 #endif
4526
4527 #if defined(_WIN32)
4528 #define with_no_vtable __declspec(novtable)
4529 #else
4530 #define with_no_vtable
4531 #endif
4532
4533 #define in_consteval (::std::is_constant_evaluated())
4534
4535 #define no_vtable_struct struct with_no_vtable
4536 #define no_vtable_class class with_no_vtable
4537
4538 //file_end
4539
4540 #line 20 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/die.hpp"
4541
4543 [[noreturn]]inline void die()noexcept{
4544 #if defined(_MSC_VER)
4545 __debugbreak();
4546 #endif
4547 #if defined(_WINMAIN_)
4548 ::MessageBoxW(NULL,L"elc died.",NULL,MB_ICONERROR);
4549 #else
4550 ::std::fputs("elc died.\n",stderr);
4551 ::std::fflush(stderr);
4552 #endif
4553 ::std::abort();
4554 }
4557 [[noreturn]]inline void die_with(const char_t*err_msg)noexcept{
4558 #if defined(_MSC_VER)
4559 __debugbreak();
4560 #endif
4562 26485//数组转型警告diss
4563 26475//强转警告diss
4564 26481//指针操作警告diss
4565 26429//nullness警告diss
4566 )
4567 if(err_msg){
4568 ::std::mbstate_t stat{};
4569 if(::std::setlocale(LC_CTYPE,"en_US.utf8")==nullptr)
4570 die();
4571 push_and_disable_msvc_warning(26494);//未初始化警告diss
4572 char err_msg_in_char[2048];
4573 char* err_msg_write = err_msg_in_char;
4574 size_t s;
4575 char_t c;
4577 floop{
4578 c=*err_msg++;
4579 if(c==0)
4580 break;
4581 s = ::std::c32rtomb(err_msg_write, c, &stat);
4582 if(s == size_t(-1))
4583 die();
4584 err_msg_write += s;
4585 }
4586 *err_msg_write = '\0';
4587 #if defined(_WINMAIN_)
4588 wchar_t err_msg_in_wchar[2048];
4589 MultiByteToWideChar(CP_UTF8, 0, err_msg_in_char, -1, err_msg_in_wchar, 2048);
4590 ::MessageBoxW(NULL,err_msg_in_wchar,NULL,MB_ICONERROR);
4591 #else
4592 ::std::fputs("elc died because:\n",stderr);
4593 ::std::fputs(err_msg_in_char,stderr);
4594 ::std::fputc('\n',stderr);
4595 ::std::fflush(stderr);
4596 #endif
4597 }
4598 ::std::abort();
4600 }
4601
4602 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_undefs.hpp"
4603 //_undefs.hpp
4604 /*
4605 未完成的elc解释器_share文件
4606 由steve02081504与Alex0125设计、编写
4607 转载时请在不对此文件做任何修改的同时注明出处
4608 项目地址:https://github.com/steve02081504/ELC
4609 */
4610
4611 //defs at "_defs.hpp"
4612
4613 #if defined(_MSC_VER)
4614 #pragma warning(pop)
4615 #endif
4616 #undef suppress_msvc_warning
4617 #undef disable_msvc_warning
4618 #undef push_msvc_warning
4619 #undef pop_msvc_warning
4620 #undef push_and_disable_msvc_warning
4621
4622 //for basic_environment.hpp
4623 #undef BIT_POSSIBILITY
4624 //
4625 #if defined(ELC_VOID_NAME)
4626 #define void the_void
4627 #endif
4628
4629 // #undef often_noexcept
4630 #undef noexcept_as
4631 #undef noexcept_as_auto
4632 #undef constexpr_as
4633 #undef constexpr_as_auto
4634
4635 #undef using_method_from_base_t
4636 #undef using_method_from_value
4637
4638 #undef floop
4639 #undef enable_adl
4640
4641 #undef re_declvalue
4642 #undef re_decltype
4643
4644 #undef declvalue
4645
4646 #undef template_error
4647 #undef template_warning
4648
4649 #undef type_info_of
4650 #undef type_name_of
4651
4652 #undef is_common_attribute
4653 #undef is_special_attribute
4654
4655 #undef has_attribute
4656 #undef not_has_attribute
4657
4658 #undef float_size_of
4659 #undef bitnum_of
4660
4661 #undef def_common_attribute_with_nothing
4662 #undef def_special_attribute_with_nothing
4663
4664 #undef common_attribute_t
4665 #undef special_attribute_t
4666
4667 #undef enable_if
4668 #undef enabled_by_default
4669 #undef disabled_by_default
4670 #undef enable_if_not_ill_form
4671 #undef enable_flag
4672
4673 #undef was_an_ill_form
4674 #undef was_an_ill_form_with_parameter
4675 #undef was_not_an_ill_form
4676 #undef was_not_an_ill_form_and_noexcept
4677 #undef was_not_an_ill_form_with_parameter
4678
4679 #undef recursive_lambda
4680 #undef get_recursive_lambda_caller
4681 #undef lambda
4682 #undef lambda_with_catch
4683 #undef self_recursion
4684 #undef lambda_RLSRRS
4685
4686 #undef MAGIC
4687
4688 #undef nothing
4689
4690 #undef elseif
4691 #undef _big_than_
4692 #undef _small_than_
4693
4694 #if defined(_MSC_VER)
4695 #undef not
4696 #undef and
4697 #undef or
4698 #endif
4699
4700 #undef INTER_NAMESPACE
4701 #undef BREAK_NAMESPACE
4702
4703 #undef szie
4704 #undef form
4705
4706 #undef template_name
4707 #undef type_name
4708
4709 #undef not_in_debug
4710
4711 #undef es
4712 #undef ec
4713
4714 #undef ELC_TEST_EVENTNAME
4715
4716 #undef override_instance_struct
4717
4718 #undef distinctive
4719
4720 #undef force_inline
4721
4722 #undef with_no_vtable
4723
4724 #undef in_consteval
4725
4726 #undef no_vtable_struct
4727 #undef no_vtable_class
4728
4729 //file_end
4730
4731 #line 82 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/die.hpp"
4732 }
4733 namespace elc::defs{
4734 using namespace elc::APIs::die;
4735 }
4736 #endif
4737
4738 //file_end
4739
4740 #line 15 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/_body.hpp"
4741 //include locale:自然语言相关的字符串
4742 //strings
4743 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/locale/using.hpp"
4744 //using.hpp
4745 /*
4746 未完成的elc解释器_share文件
4747 由steve02081504与Alex0125设计、编写
4748 转载时请在不对此文件做任何修改的同时注明出处
4749 项目地址:https://github.com/steve02081504/ELC
4750 */
4751 /*
4752 locale说明
4753 elc使用的字符串.
4754 调整这些,实现快速本地化.
4755 */
4756 #if !defined(ELC_LOCALE)
4757 #define ELC_LOCALE
4758 #include <locale>
4759 //
4760 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/default_data_type.hpp"
4761 //default_data_type.hpp
4762 /*
4763 未完成的elc解释器_share文件
4764 由steve02081504与Alex0125设计、编写
4765 转载时请在不对此文件做任何修改的同时注明出处
4766 项目地址:https://github.com/steve02081504/ELC
4767 */
4768 namespace elc{
4769 /*ELC内部string统一采用char_t宽字符,使用setlocale(LC_ALL,"en_US.utf8")下的UTF编码。*/
4770 typedef char32_t char_t;
4771 /*ELC内部钦定int_t类型*/
4772 typedef int64_t int_t;
4773 /*ELC内部钦定uint_t类型*/
4774 typedef uint64_t uint_t;
4775 /*ELC内部钦定float_t类型*/
4776 typedef double float_t;
4777 /*ELC内部钦定float_size_t类型,用以描述内存大小的浮点状况*/
4778 typedef long double float_size_t;
4779 }
4780
4781 //file_end
4782
4783 #line 17 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/locale/using.hpp"
4784 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/locale/_char.hpp"
4785 //_char.hpp
4786 /*
4787 未完成的elc解释器_share文件
4788 由steve02081504与Alex0125设计、编写
4789 转载时请在不对此文件做任何修改的同时注明出处
4790 项目地址:https://github.com/steve02081504/ELC
4791 */
4793 inline const ::std::locale default_locale{"en_US.utf8"};
4794 namespace char_n{
4795 template <class charT> bool isspace (charT c){ return isspace (c,default_locale); }
4796 template <class charT> bool isprint (charT c){ return isprint (c,default_locale); }
4797 template <class charT> bool iscntrl (charT c){ return iscntrl (c,default_locale); }
4798 template <class charT> bool isupper (charT c){ return isupper (c,default_locale); }
4799 template <class charT> bool islower (charT c){ return islower (c,default_locale); }
4800 template <class charT> bool isalpha (charT c){ return isalpha (c,default_locale); }
4801 template <class charT> bool isdigit (charT c){ return isdigit (c,default_locale); }
4802 template <class charT> bool ispunct (charT c){ return ispunct (c,default_locale); }
4803 template <class charT> bool isxdigit(charT c){ return isxdigit(c,default_locale); }
4804 template <class charT> bool isalnum (charT c){ return isalnum (c,default_locale); }
4805 template <class charT> bool isgraph (charT c){ return isgraph (c,default_locale); }
4806 template <class charT> charT toupper(charT c){ return toupper (c,default_locale); }
4807 template <class charT> charT tolower(charT c){ return tolower (c,default_locale); }
4808 }
4809 }
4810
4811 //file_end
4812
4813 #line 18 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/locale/using.hpp"
4814 //
4815 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base_defs"
4816 //base_defs
4817 //at namespace ::
4818 /*
4819 未完成的elc解释器include文件
4820 由steve02081504与Alex0125设计、编写
4821 转载时请在不对此文件做任何修改的同时注明出处
4822 项目地址:https://github.com/steve02081504/ELC
4823 */
4824 #line 22 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base_defs"
4825
4826 //file_end
4827
4828 #line 20 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/locale/using.hpp"
4829 //
4830 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
4831 //_defs.hpp
4832 /*
4833 未完成的elc解释器_share文件
4834 由steve02081504与Alex0125设计、编写
4835 转载时请在不对此文件做任何修改的同时注明出处
4836 项目地址:https://github.com/steve02081504/ELC
4837 */
4838
4839 //undefs at "_undefs.hpp"
4840
4841 //set ELC_WARNING_LEVEL default to 4(max)
4842 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
4843
4844 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/basic_environment.hpp"
4845 //basic_environment.hpp
4846 /*
4847 未完成的elc解释器_share文件
4848 由steve02081504与Alex0125设计、编写
4849 转载时请在不对此文件做任何修改的同时注明出处
4850 项目地址:https://github.com/steve02081504/ELC
4851 */
4852
4855 #define BIT_POSSIBILITY 2
4856
4857 //file_end
4858
4859 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
4860
4861 #if defined(_MSC_VER)
4862 #pragma warning(push,ELC_WARNING_LEVEL)
4863 #pragma warning(disable:4099)//class与struct混用警告diss
4864 #pragma warning(disable:26812)//enum class安利diss.
4865 #pragma warning(disable:4584)//重复子类警告diss
4866 #pragma warning(disable:4250)//域控制继承警告diss
4867 #pragma warning(disable:26432)//不完全默认方法警告diss
4868 #pragma warning(disable:26435)//virtual override方法警告diss
4869 #pragma warning(disable:26481)//容器安利diss
4870 #pragma warning(disable:26446)//gsl::at安利diss
4871 #pragma warning(disable:26434)//方法覆盖警告diss
4872 #pragma warning(disable:26429)//gsl::not_null安利diss
4873 #pragma warning(disable:26471)//对void*进行static_cast安利diss
4874 #pragma warning(disable:26474)//隐式指针转换显式cast警告diss
4875 #pragma warning(disable:26473)//相同指针显式cast警告diss
4876 #pragma warning(disable:26456)//隐藏非虚运算符警告diss
4877 #pragma warning(disable:26485)//数组作指针警告diss
4878 #pragma warning(disable:26490)//reinterpret_cast警告diss
4879 #pragma warning(disable:26472)//static_cast窄幅转换警告diss
4880 #pragma warning(disable:26482)//非常数数组索引警告diss
4881 #pragma warning(disable:26493)//c_cast转换警告diss:虽然有用但是太烦了,爬
4882 #endif
4883 #if defined(_MSC_VER)
4884 #define suppress_msvc_warning(...) __pragma(warning(suppress:__VA_ARGS__))
4885 #define disable_msvc_warning(...) __pragma(warning(disable:__VA_ARGS__))
4886 #define push_msvc_warning() __pragma(warning(push))
4887 #define pop_msvc_warning() __pragma(warning(pop))
4888 #define push_and_disable_msvc_warning(...) push_msvc_warning() disable_msvc_warning(__VA_ARGS__)
4889 #else
4890 #define suppress_msvc_warning(...)
4891 #define disable_msvc_warning(...)
4892 #define push_msvc_warning()
4893 #define pop_msvc_warning()
4894 #define push_and_disable_msvc_warning(...)
4895 #endif
4896 //
4897 #if defined(ELC_VOID_NAME)
4898 #undef void
4899 #endif
4900
4901 // #define often_noexcept
4902 #define noexcept_as(...) noexcept(noexcept((__VA_ARGS__)))//dnmd C艹标准就是没有noexcept_as_auto
4903 #define noexcept_as_auto MAGIC//哦现在有了
4904 #define constexpr_as(...) MAGIC constexpr//( •̀ ω •́ )✌
4905 #define constexpr_as_auto MAGIC MAGIC constexpr//✌( •̀ ω •́ )✌
4906
4907 #define using_method_from_base_t(name,...) \
4908 template<class...Args> requires was_not_an_ill_form(declvalue(base_t).name(declvalue(Args)...))\
4909 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(base_t::name(declvalue(Args)...))\
4910 {\
4911 return base_t::name(forward<Args>(rest)...);\
4912 }\
4913
4914 #define using_method_from_value(name,value_name,...) \
4915 template<class...Args> requires was_not_an_ill_form(re_declvalue(value_name).name(declvalue(Args)...))\
4916 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(re_declvalue(value_name).name(declvalue(Args)...))\
4917 {\
4918 return value_name.name(forward<Args>(rest)...);\
4919 }\
4920
4921 #define floop while(__builtin_is_my_dick_still_there())
4922 #define enable_adl(name) void name()noexcept=delete
4923
4924 #define re_declvalue(...) (declvalue(decltype(__VA_ARGS__)))
4925 #define re_decltype(...) (decltype(declvalue(__VA_ARGS__)))
4926
4927 #define declvalue(...) (::std::declval<__VA_ARGS__>())
4928
4930 #define template_error(reason) static_assert(template_error_helper<T>,reason)
4932 #define template_warning(reason) template_warning_helper<T>(reason)
4933
4934 //for type_info
4935 #define type_info_of(...) base_type_info_t(typeid(__VA_ARGS__))
4936 #define type_name_of(...) (type_info_of(__VA_ARGS__).name())
4937
4938 #define is_common_attribute(name) public attribute<T,name<T>>
4939 #define is_special_attribute(name) public attribute<T,name>
4940
4941 #define has_attribute(...) template_name has_attribute_helper<__VA_ARGS__>()
4942 #define not_has_attribute(...) template_name not_has_has_attribute_helper<__VA_ARGS__>()
4943
4944 //for float_size_t
4945 #define float_size_of(...) (float_size_t{sizeof(__VA_ARGS__)})
4946 //bitnum_of
4947 #define bitnum_of(...) (bitnumof<__VA_ARGS__>)
4948
4949 //for attribute
4950 #define def_common_attribute_with_nothing(name) \
4951 template<typename T>\
4952 class name{}\
4953
4954 #define def_special_attribute_with_nothing(name) \
4955 class name{}\
4956
4957 #define common_attribute_t template<class>class
4958 #define special_attribute_t class
4959
4968 #define enable_if(...) class enable_state= ::std::enable_if_t<__VA_ARGS__>
4970 #define enabled_by_default class enable_state=void
4972 #define disabled_by_default class enable_state= ::std::enable_if_t<false>
4974 #define enable_if_not_ill_form(...) class enable_state= ::std::void_t<decltype(__VA_ARGS__)>
4976 #define enable_flag class enable_state
4977
4978 #define was_an_ill_form(...) (!was_not_an_ill_form(__VA_ARGS__))
4979 #define was_an_ill_form_with_parameter(...) (!was_not_an_ill_form_with_parameter(__VA_ARGS__))
4980 #define was_not_an_ill_form(...) (bool(requires{__VA_ARGS__;}))
4981 #define was_not_an_ill_form_and_noexcept(...) (bool(requires{__VA_ARGS__;{__VA_ARGS__}noexcept;}))
4982 #define was_not_an_ill_form_with_parameter(...) (bool(requires __VA_ARGS__ ))
4983
4985 #define recursive_lambda(...) lambda(auto&&lambda_RLSRRS,__VA_ARGS__)
4987 #define get_recursive_lambda_caller(name) \
4988 lambda_with_catch(&)(auto&&...Args){\
4989 return name(name,Args...);\
4990 }
4992 #define lambda []
4994 #define lambda_with_catch(...) [__VA_ARGS__]
4996 #define self_recursion(...) lambda_RLSRRS(lambda_RLSRRS,__VA_ARGS__)
4997 //recursive_lambda_self_referential_reserved_symbolname
4998 #define lambda_RLSRRS _my_jb_super_sb_name_
4999
5000 #define MAGIC//ahh,ko no tenno da!
5001
5003 #define nothing
5004
5006 #define elseif else if
5008 #define _big_than_ >
5010 #define _small_than_ <
5011
5012 #if defined(_MSC_VER)
5013 #define not !
5014 #define and &&
5015 #define or ||
5016 #endif
5017
5019 #define INTER_NAMESPACE(NAMESPACENAME) namespace NAMESPACENAME{
5021 #define BREAK_NAMESPACE }
5022
5024 #define template_name template
5026 #define type_name class
5027
5028 #if defined(DEBUG) || defined(_DEBUG)
5029 #define not_in_debug 0
5030 #else
5031 #define not_in_debug 1
5032 #endif
5033
5034 #define es U""
5035 #define ec(ch) U ## ch
5036
5037 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
5038 #define ELC_TEST_EVENTNAME(name) stest_eventer _the_stest_eventer__(L""name)
5039 #else
5040 #define ELC_TEST_EVENTNAME(name)
5041 #endif
5042
5043 #define override_instance_struct \
5044 protected:\
5045 virtual void abstract_method_unget_this()noexcept_as(instance_struct<this_t>::abstract_method_unget_this())override{instance_struct<this_t>::abstract_method_unget_this();}\
5046 virtual void* _abstract_method_copy_get_this()noexcept_as(instance_struct<this_t>::_abstract_method_copy_get_this())override{return instance_struct<this_t>::_abstract_method_copy_get_this();}\
5047 virtual void* _abstract_method_get_resize_this(size_t size)noexcept_as(instance_struct<this_t>::instance_struct<this_t>::_abstract_method_get_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_resize_this(size);}\
5048 virtual void* _abstract_method_get_forward_resize_this(size_t size)noexcept_as(instance_struct<this_t>::_abstract_method_get_forward_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_forward_resize_this(size);}\
5049 virtual size_t abstract_method_get_size_of_get_for_this()noexcept override{return instance_struct<this_t>::abstract_method_get_size_of_get_for_this();}
5050
5051 #if defined(_WIN32)
5052 #define distinctive __declspec(dllexport)
5053 #else
5054 #define distinctive
5055 #endif
5056
5057 #if defined(_WIN32)
5058 #define force_inline __forceinline
5059 #elif defined(__GNUC__)
5060 #define force_inline __attribute__((always_inline)) inline
5061 #else
5062 #define force_inline inline
5063 #endif
5064
5065 #if defined(_WIN32)
5066 #define with_no_vtable __declspec(novtable)
5067 #else
5068 #define with_no_vtable
5069 #endif
5070
5071 #define in_consteval (::std::is_constant_evaluated())
5072
5073 #define no_vtable_struct struct with_no_vtable
5074 #define no_vtable_class class with_no_vtable
5075
5076 //file_end
5077
5078 #line 22 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/locale/using.hpp"
5079 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/locale/zh_cn.hpp"
5080 //zh_cn.hpp
5081 /*
5082 未完成的elc解释器_share文件
5083 由steve02081504与Alex0125设计、编写
5084 转载时请在不对此文件做任何修改的同时注明出处
5085 项目地址:https://github.com/steve02081504/ELC
5086 */
5087 /*
5088 locale说明
5089 elc使用的字符串.
5090 调整这些,实现快速本地化.
5091 */
5093
5094 }
5096 inline namespace gc{
5097 inline constexpr auto gc_fail=es"gc失败"_constexpr_str;
5098 inline constexpr auto empty_gc_method=es"gc方法为空时gc被调用"_constexpr_str;
5099 }
5100 inline namespace code_convert{
5101 inline constexpr auto setlocale_error=es"setlocale出错"_constexpr_str;
5102 inline constexpr auto code_convert_error=es"编码转换出错"_constexpr_str;
5103 }
5104 inline namespace lib_load{
5105 inline constexpr auto null_lib=es"访问null处的lib对象"_constexpr_str;
5106 }
5107 inline namespace exception{
5108 inline constexpr auto unknow_error=es"未知错误"_constexpr_str;
5109 inline constexpr auto core_runtime_internal_helper_leak=es"未知错误"_constexpr_str;
5110 }
5111 inline namespace base_read{
5112 inline constexpr auto ending_of_expr_beyond_expectations=es"表达式的结尾超出预期"_constexpr_str;
5113 inline constexpr auto expr_incomplete=es"表达式未完成"_constexpr_str;
5114 inline constexpr auto symbol_is_undefined=es"此符号未定义"_constexpr_str;
5115 inline constexpr auto expr_too_outrageous=es"表达式过于离谱"_constexpr_str;
5116 }
5117 inline namespace package_symbol_loader{
5118 inline constexpr auto load_failed=es"无法加载的package_symbol_loader"_constexpr_str;
5119 inline constexpr auto load_interface_failed=es"package_symbol_loader缺失load_interface"_constexpr_str;
5120 }
5121 }
5122
5123 //file_end
5124
5125 #line 23 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/locale/using.hpp"
5126 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_undefs.hpp"
5127 //_undefs.hpp
5128 /*
5129 未完成的elc解释器_share文件
5130 由steve02081504与Alex0125设计、编写
5131 转载时请在不对此文件做任何修改的同时注明出处
5132 项目地址:https://github.com/steve02081504/ELC
5133 */
5134
5135 //defs at "_defs.hpp"
5136
5137 #if defined(_MSC_VER)
5138 #pragma warning(pop)
5139 #endif
5140 #undef suppress_msvc_warning
5141 #undef disable_msvc_warning
5142 #undef push_msvc_warning
5143 #undef pop_msvc_warning
5144 #undef push_and_disable_msvc_warning
5145
5146 //for basic_environment.hpp
5147 #undef BIT_POSSIBILITY
5148 //
5149 #if defined(ELC_VOID_NAME)
5150 #define void the_void
5151 #endif
5152
5153 // #undef often_noexcept
5154 #undef noexcept_as
5155 #undef noexcept_as_auto
5156 #undef constexpr_as
5157 #undef constexpr_as_auto
5158
5159 #undef using_method_from_base_t
5160 #undef using_method_from_value
5161
5162 #undef floop
5163 #undef enable_adl
5164
5165 #undef re_declvalue
5166 #undef re_decltype
5167
5168 #undef declvalue
5169
5170 #undef template_error
5171 #undef template_warning
5172
5173 #undef type_info_of
5174 #undef type_name_of
5175
5176 #undef is_common_attribute
5177 #undef is_special_attribute
5178
5179 #undef has_attribute
5180 #undef not_has_attribute
5181
5182 #undef float_size_of
5183 #undef bitnum_of
5184
5185 #undef def_common_attribute_with_nothing
5186 #undef def_special_attribute_with_nothing
5187
5188 #undef common_attribute_t
5189 #undef special_attribute_t
5190
5191 #undef enable_if
5192 #undef enabled_by_default
5193 #undef disabled_by_default
5194 #undef enable_if_not_ill_form
5195 #undef enable_flag
5196
5197 #undef was_an_ill_form
5198 #undef was_an_ill_form_with_parameter
5199 #undef was_not_an_ill_form
5200 #undef was_not_an_ill_form_and_noexcept
5201 #undef was_not_an_ill_form_with_parameter
5202
5203 #undef recursive_lambda
5204 #undef get_recursive_lambda_caller
5205 #undef lambda
5206 #undef lambda_with_catch
5207 #undef self_recursion
5208 #undef lambda_RLSRRS
5209
5210 #undef MAGIC
5211
5212 #undef nothing
5213
5214 #undef elseif
5215 #undef _big_than_
5216 #undef _small_than_
5217
5218 #if defined(_MSC_VER)
5219 #undef not
5220 #undef and
5221 #undef or
5222 #endif
5223
5224 #undef INTER_NAMESPACE
5225 #undef BREAK_NAMESPACE
5226
5227 #undef szie
5228 #undef form
5229
5230 #undef template_name
5231 #undef type_name
5232
5233 #undef not_in_debug
5234
5235 #undef es
5236 #undef ec
5237
5238 #undef ELC_TEST_EVENTNAME
5239
5240 #undef override_instance_struct
5241
5242 #undef distinctive
5243
5244 #undef force_inline
5245
5246 #undef with_no_vtable
5247
5248 #undef in_consteval
5249
5250 #undef no_vtable_struct
5251 #undef no_vtable_class
5252
5253 //file_end
5254
5255 #line 24 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/locale/using.hpp"
5256 //
5257 #endif
5258
5259 //file_end
5260
5261 #line 17 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/_body.hpp"
5262
5263 namespace elc::defs{ //在elc::defs中定义内容
5264 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
5265 //_defs.hpp
5266 /*
5267 未完成的elc解释器basic文件
5268 由steve02081504与Alex0125设计、编写
5269 转载时请在不对此文件做任何修改的同时注明出处
5270 项目地址:https://github.com/steve02081504/ELC
5271 */
5272 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
5273 //_defs.hpp
5274 /*
5275 未完成的elc解释器_share文件
5276 由steve02081504与Alex0125设计、编写
5277 转载时请在不对此文件做任何修改的同时注明出处
5278 项目地址:https://github.com/steve02081504/ELC
5279 */
5280
5281 //undefs at "_undefs.hpp"
5282
5283 //set ELC_WARNING_LEVEL default to 4(max)
5284 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
5285
5286 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/basic_environment.hpp"
5287 //basic_environment.hpp
5288 /*
5289 未完成的elc解释器_share文件
5290 由steve02081504与Alex0125设计、编写
5291 转载时请在不对此文件做任何修改的同时注明出处
5292 项目地址:https://github.com/steve02081504/ELC
5293 */
5294
5297 #define BIT_POSSIBILITY 2
5298
5299 //file_end
5300
5301 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
5302
5303 #if defined(_MSC_VER)
5304 #pragma warning(push,ELC_WARNING_LEVEL)
5305 #pragma warning(disable:4099)//class与struct混用警告diss
5306 #pragma warning(disable:26812)//enum class安利diss.
5307 #pragma warning(disable:4584)//重复子类警告diss
5308 #pragma warning(disable:4250)//域控制继承警告diss
5309 #pragma warning(disable:26432)//不完全默认方法警告diss
5310 #pragma warning(disable:26435)//virtual override方法警告diss
5311 #pragma warning(disable:26481)//容器安利diss
5312 #pragma warning(disable:26446)//gsl::at安利diss
5313 #pragma warning(disable:26434)//方法覆盖警告diss
5314 #pragma warning(disable:26429)//gsl::not_null安利diss
5315 #pragma warning(disable:26471)//对void*进行static_cast安利diss
5316 #pragma warning(disable:26474)//隐式指针转换显式cast警告diss
5317 #pragma warning(disable:26473)//相同指针显式cast警告diss
5318 #pragma warning(disable:26456)//隐藏非虚运算符警告diss
5319 #pragma warning(disable:26485)//数组作指针警告diss
5320 #pragma warning(disable:26490)//reinterpret_cast警告diss
5321 #pragma warning(disable:26472)//static_cast窄幅转换警告diss
5322 #pragma warning(disable:26482)//非常数数组索引警告diss
5323 #pragma warning(disable:26493)//c_cast转换警告diss:虽然有用但是太烦了,爬
5324 #endif
5325 #if defined(_MSC_VER)
5326 #define suppress_msvc_warning(...) __pragma(warning(suppress:__VA_ARGS__))
5327 #define disable_msvc_warning(...) __pragma(warning(disable:__VA_ARGS__))
5328 #define push_msvc_warning() __pragma(warning(push))
5329 #define pop_msvc_warning() __pragma(warning(pop))
5330 #define push_and_disable_msvc_warning(...) push_msvc_warning() disable_msvc_warning(__VA_ARGS__)
5331 #else
5332 #define suppress_msvc_warning(...)
5333 #define disable_msvc_warning(...)
5334 #define push_msvc_warning()
5335 #define pop_msvc_warning()
5336 #define push_and_disable_msvc_warning(...)
5337 #endif
5338 //
5339 #if defined(ELC_VOID_NAME)
5340 #undef void
5341 #endif
5342
5343 // #define often_noexcept
5344 #define noexcept_as(...) noexcept(noexcept((__VA_ARGS__)))//dnmd C艹标准就是没有noexcept_as_auto
5345 #define noexcept_as_auto MAGIC//哦现在有了
5346 #define constexpr_as(...) MAGIC constexpr//( •̀ ω •́ )✌
5347 #define constexpr_as_auto MAGIC MAGIC constexpr//✌( •̀ ω •́ )✌
5348
5349 #define using_method_from_base_t(name,...) \
5350 template<class...Args> requires was_not_an_ill_form(declvalue(base_t).name(declvalue(Args)...))\
5351 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(base_t::name(declvalue(Args)...))\
5352 {\
5353 return base_t::name(forward<Args>(rest)...);\
5354 }\
5355
5356 #define using_method_from_value(name,value_name,...) \
5357 template<class...Args> requires was_not_an_ill_form(re_declvalue(value_name).name(declvalue(Args)...))\
5358 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(re_declvalue(value_name).name(declvalue(Args)...))\
5359 {\
5360 return value_name.name(forward<Args>(rest)...);\
5361 }\
5362
5363 #define floop while(__builtin_is_my_dick_still_there())
5364 #define enable_adl(name) void name()noexcept=delete
5365
5366 #define re_declvalue(...) (declvalue(decltype(__VA_ARGS__)))
5367 #define re_decltype(...) (decltype(declvalue(__VA_ARGS__)))
5368
5369 #define declvalue(...) (::std::declval<__VA_ARGS__>())
5370
5372 #define template_error(reason) static_assert(template_error_helper<T>,reason)
5374 #define template_warning(reason) template_warning_helper<T>(reason)
5375
5376 //for type_info
5377 #define type_info_of(...) base_type_info_t(typeid(__VA_ARGS__))
5378 #define type_name_of(...) (type_info_of(__VA_ARGS__).name())
5379
5380 #define is_common_attribute(name) public attribute<T,name<T>>
5381 #define is_special_attribute(name) public attribute<T,name>
5382
5383 #define has_attribute(...) template_name has_attribute_helper<__VA_ARGS__>()
5384 #define not_has_attribute(...) template_name not_has_has_attribute_helper<__VA_ARGS__>()
5385
5386 //for float_size_t
5387 #define float_size_of(...) (float_size_t{sizeof(__VA_ARGS__)})
5388 //bitnum_of
5389 #define bitnum_of(...) (bitnumof<__VA_ARGS__>)
5390
5391 //for attribute
5392 #define def_common_attribute_with_nothing(name) \
5393 template<typename T>\
5394 class name{}\
5395
5396 #define def_special_attribute_with_nothing(name) \
5397 class name{}\
5398
5399 #define common_attribute_t template<class>class
5400 #define special_attribute_t class
5401
5410 #define enable_if(...) class enable_state= ::std::enable_if_t<__VA_ARGS__>
5412 #define enabled_by_default class enable_state=void
5414 #define disabled_by_default class enable_state= ::std::enable_if_t<false>
5416 #define enable_if_not_ill_form(...) class enable_state= ::std::void_t<decltype(__VA_ARGS__)>
5418 #define enable_flag class enable_state
5419
5420 #define was_an_ill_form(...) (!was_not_an_ill_form(__VA_ARGS__))
5421 #define was_an_ill_form_with_parameter(...) (!was_not_an_ill_form_with_parameter(__VA_ARGS__))
5422 #define was_not_an_ill_form(...) (bool(requires{__VA_ARGS__;}))
5423 #define was_not_an_ill_form_and_noexcept(...) (bool(requires{__VA_ARGS__;{__VA_ARGS__}noexcept;}))
5424 #define was_not_an_ill_form_with_parameter(...) (bool(requires __VA_ARGS__ ))
5425
5427 #define recursive_lambda(...) lambda(auto&&lambda_RLSRRS,__VA_ARGS__)
5429 #define get_recursive_lambda_caller(name) \
5430 lambda_with_catch(&)(auto&&...Args){\
5431 return name(name,Args...);\
5432 }
5434 #define lambda []
5436 #define lambda_with_catch(...) [__VA_ARGS__]
5438 #define self_recursion(...) lambda_RLSRRS(lambda_RLSRRS,__VA_ARGS__)
5439 //recursive_lambda_self_referential_reserved_symbolname
5440 #define lambda_RLSRRS _my_jb_super_sb_name_
5441
5442 #define MAGIC//ahh,ko no tenno da!
5443
5445 #define nothing
5446
5448 #define elseif else if
5450 #define _big_than_ >
5452 #define _small_than_ <
5453
5454 #if defined(_MSC_VER)
5455 #define not !
5456 #define and &&
5457 #define or ||
5458 #endif
5459
5461 #define INTER_NAMESPACE(NAMESPACENAME) namespace NAMESPACENAME{
5463 #define BREAK_NAMESPACE }
5464
5466 #define template_name template
5468 #define type_name class
5469
5470 #if defined(DEBUG) || defined(_DEBUG)
5471 #define not_in_debug 0
5472 #else
5473 #define not_in_debug 1
5474 #endif
5475
5476 #define es U""
5477 #define ec(ch) U ## ch
5478
5479 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
5480 #define ELC_TEST_EVENTNAME(name) stest_eventer _the_stest_eventer__(L""name)
5481 #else
5482 #define ELC_TEST_EVENTNAME(name)
5483 #endif
5484
5485 #define override_instance_struct \
5486 protected:\
5487 virtual void abstract_method_unget_this()noexcept_as(instance_struct<this_t>::abstract_method_unget_this())override{instance_struct<this_t>::abstract_method_unget_this();}\
5488 virtual void* _abstract_method_copy_get_this()noexcept_as(instance_struct<this_t>::_abstract_method_copy_get_this())override{return instance_struct<this_t>::_abstract_method_copy_get_this();}\
5489 virtual void* _abstract_method_get_resize_this(size_t size)noexcept_as(instance_struct<this_t>::instance_struct<this_t>::_abstract_method_get_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_resize_this(size);}\
5490 virtual void* _abstract_method_get_forward_resize_this(size_t size)noexcept_as(instance_struct<this_t>::_abstract_method_get_forward_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_forward_resize_this(size);}\
5491 virtual size_t abstract_method_get_size_of_get_for_this()noexcept override{return instance_struct<this_t>::abstract_method_get_size_of_get_for_this();}
5492
5493 #if defined(_WIN32)
5494 #define distinctive __declspec(dllexport)
5495 #else
5496 #define distinctive
5497 #endif
5498
5499 #if defined(_WIN32)
5500 #define force_inline __forceinline
5501 #elif defined(__GNUC__)
5502 #define force_inline __attribute__((always_inline)) inline
5503 #else
5504 #define force_inline inline
5505 #endif
5506
5507 #if defined(_WIN32)
5508 #define with_no_vtable __declspec(novtable)
5509 #else
5510 #define with_no_vtable
5511 #endif
5512
5513 #define in_consteval (::std::is_constant_evaluated())
5514
5515 #define no_vtable_struct struct with_no_vtable
5516 #define no_vtable_class class with_no_vtable
5517
5518 //file_end
5519
5520 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
5521
5522 //file_end
5523
5524 #line 20 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/_body.hpp"
5525
5526 namespace memory{
5527 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/lifetime/_body.hpp"
5528 //_body.hpp
5529 //at namespace elc::defs::memory
5530 /*
5531 未完成的elc解释器base文件
5532 由steve02081504与Alex0125设计、编写
5533 转载时请在不对此文件做任何修改的同时注明出处
5534 项目地址:https://github.com/steve02081504/ELC
5535 */
5536 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/lifetime/defs.hpp"
5537 //defs.hpp
5538 //at namespace elc::defs::memory
5539 /*
5540 未完成的elc解释器base文件
5541 由steve02081504与Alex0125设计、编写
5542 转载时请在不对此文件做任何修改的同时注明出处
5543 项目地址:https://github.com/steve02081504/ELC
5544 */
5545 namespace lifetime_n{
5546 class copy_t;
5547
5548 class move_t;
5549 //
5550
5551 template<class T>
5552 class construct_t;
5553 template<class T,class...Args>
5554 constexpr bool construct_able=::std::is_constructible_v<T,Args...>;
5555 template<class T,class...Args>
5556 constexpr bool construct_nothrow=::std::is_nothrow_constructible_v<T,Args...>;
5557 template<class T,class...Args>
5558 constexpr bool construct_trivial=::std::is_trivially_constructible_v<T,Args...>;
5559
5560 class destruct_t;
5561 template<class T>
5562 constexpr bool destruct_able=::std::is_destructible_v<T>;
5563 template<class T>
5564 constexpr bool destruct_nothrow=::std::is_nothrow_destructible_v<T>;
5565 template<class T>
5566 constexpr bool destruct_trivial=::std::is_trivially_destructible_v<T>;
5567 //
5568
5569 class copy_construct_t;
5570 template<class T>
5571 constexpr bool copy_construct_able=::std::is_copy_constructible_v<T>;
5572 template<class T>
5573 constexpr bool copy_construct_nothrow=::std::is_nothrow_copy_constructible_v<T>;
5574 template<class T>
5575 constexpr bool copy_construct_trivial=::std::is_trivially_copy_constructible_v<T>;
5576
5577 class move_construct_t;
5578 template<class T>
5579 constexpr bool move_construct_able=::std::is_move_constructible_v<T>;
5580 template<class T>
5581 constexpr bool move_construct_nothrow=::std::is_nothrow_move_constructible_v<T>;
5582 template<class T>
5583 constexpr bool move_construct_trivial=::std::is_trivially_move_constructible_v<T>;
5584 //
5585
5586 class copy_assign_t;
5587 template<class T>
5588 constexpr bool copy_assign_able=::std::is_copy_assignable_v<T>;
5589 template<class T>
5590 constexpr bool copy_assign_nothrow=::std::is_nothrow_copy_assignable_v<T>;
5591 template<class T>
5592 constexpr bool copy_assign_trivial=::std::is_trivially_copy_assignable_v<T>;
5593
5594 class move_assign_t;
5595 template<class T>
5596 constexpr bool move_assign_able=::std::is_move_assignable_v<T>;
5597 template<class T>
5598 constexpr bool move_assign_nothrow=::std::is_nothrow_move_assignable_v<T>;
5599 template<class T>
5600 constexpr bool move_assign_trivial=::std::is_trivially_move_assignable_v<T>;
5601 //
5602
5603 template<class T> requires(::std::is_trivially_copyable_v<T>)
5604 force_inline T* super_speed_trivial_copy_from_one(T*to,const T&value,size_t size)noexcept{
5605 if constexpr(sizeof(T)==sizeof(unsigned char))
5606 ::std::memset((unsigned char*)to,(unsigned char)value,size);
5607 elseif constexpr(sizeof(T)==sizeof(wchar_t))
5608 ::std::wmemset((wchar_t*)to,(wchar_t)value,size);
5609 else
5610 if(is_all_byte_zero(value))
5611 ::std::memset(to,zero,size*sizeof(T));
5612 else
5613 ::std::fill_n(to,size,value);
5614 return to;
5615 }
5616 template<class T> requires(::std::is_trivially_copyable_v<T>)
5617 force_inline T* super_speed_trivial_copy_from_one(T*to,const T&value)noexcept{
5618 if constexpr(sizeof(T)>=sizeof(::std::max_align_t))
5619 if(is_all_byte_zero(value))
5620 ::std::memset(to,zero,sizeof(T));
5621 else
5622 *to=value;
5623 else
5624 *to=value;
5625 return to;
5626 }
5627
5636 template<typename T>
5639 template<class...Args>
5640 static constexpr bool able=construct_able<T,Args...>;
5641 template<class...Args>
5642 static constexpr bool nothrow=construct_nothrow<T,Args...>;
5643 template<class...Args>
5644 static constexpr bool trivial=construct_trivial<T,Args...>;
5645
5646 template<class...Args> requires able<Args...>
5647 [[nodiscard]]force_inline T operator()(Args&&...rest)const noexcept(nothrow<Args...>){
5648 return T(forward<Args>(rest)...);
5649 }
5652 size_t _size;
5653 constexpr void never_in_array_check()const noexcept{
5654 if constexpr(type_info<T>.has_attribute(never_in_array))
5655 template_error("You can\'t construct an array for never_in_array type.");
5656 }
5657 template<class...Args> requires able<Args...>
5658 force_inline void base_call(Args&&...rest)const noexcept(nothrow<Args...>){
5659 auto tmp=_size;
5660 while(tmp--)new(_to+tmp)T(forward<Args>(rest)...);
5661 }
5662 template<class...Args> requires able<Args...>
5663 force_inline T* operator()(Args&&...rest)const noexcept(nothrow<Args...>){
5664 never_in_array_check();
5665 base_call(forward<Args>(rest)...);
5666 return _to;
5667 }
5668 //复制构造速度优化
5669 force_inline T* operator()(const T&v)const noexcept(nothrow<const T&>)requires able<const T&>{
5670 never_in_array_check();
5671 if constexpr(trivial<const T&> && ::std::is_trivially_copyable_v<T>)
5673 else
5674 base_call(forward<const T&>(v));
5675 return _to;
5676 }
5677 //默认构造逻辑优化
5678 force_inline T* operator()()const noexcept(nothrow<>)requires able<>{
5679 never_in_array_check();
5680 if constexpr(!trivial<>)
5681 base_call();
5682 return _to;
5683 }
5684 };
5687 template<class...Args> requires able<Args...>
5688 force_inline void base_call(Args&&...rest)const noexcept(nothrow<Args...>){
5689 new(_to)T(forward<Args>(rest)...);
5690 }
5691 template<class...Args> requires able<Args...>
5692 force_inline T* operator()(Args&&...rest)const noexcept(nothrow<Args...>){
5693 base_call(forward<Args>(rest)...);
5694 return _to;
5695 }
5696 //复制构造速度优化
5697 force_inline T* operator()(const T&v)const noexcept(nothrow<const T&>)requires able<const T&>{
5698 if constexpr(trivial<const T&> && ::std::is_trivially_copyable_v<T>)
5700 else
5701 base_call(forward<const T&>(v));
5702 return _to;
5703 }
5704 //默认构造逻辑优化
5705 force_inline T* operator()()const noexcept(nothrow<>)requires able<>{
5706 if constexpr(!trivial<>)
5707 base_call();
5708 return _to;
5709 }
5710 [[nodiscard]]force_inline constexpr array_construct_t operator[](size_t size)const noexcept{return{_to,size};}
5711 };
5712 [[nodiscard]]force_inline constexpr placement_construct_t operator[](T*p)const noexcept{return{p};}
5713 };
5724 template<typename T>
5726
5736 constexpr struct destruct_t{
5737 template<class T>
5738 static constexpr bool able=destruct_able<T>||(::std::is_array_v<T>&&able<::std::remove_extent_t<T>>);
5739 template<class T>
5740 static constexpr bool nothrow=destruct_nothrow<T>||(::std::is_array_v<T>&&nothrow<::std::remove_extent_t<T>>);
5741 template<class T>
5742 static constexpr bool trivial=destruct_trivial<T>||(::std::is_array_v<T>&&trivial<::std::remove_extent_t<T>>);
5743
5744 template<class T> requires able<T>
5745 static force_inline void base_call(T*to)noexcept(nothrow<T>){
5746 if constexpr(!trivial<T>)
5747 if constexpr(::std::is_array_v<T>)
5748 for(auto&i : *to)
5749 base_call(addressof(i));
5750 else
5751 suppress_msvc_warning(26457)//虽然我不是很理解为啥调用析构函数会触发这个
5752 to->~T();
5753 }
5754
5755 template<class T> requires able<T>
5756 static void base_call([[maybe_unused]]T*begin,[[maybe_unused]]size_t size)noexcept(nothrow<T>){
5757 if constexpr(type_info<T>.has_attribute(never_in_array))
5758 template_error("You cannot perform array operations on never_in_array type.");
5759 if constexpr(!trivial<T>)
5760 while(size--)base_call(begin+size);
5761 }
5762
5763 template<class T> requires able<T>
5764 force_inline void operator()(T*begin)const noexcept(nothrow<T>){
5765 base_call(begin);
5766 }
5767
5769 size_t _size;
5770 template<class T> requires able<T>
5771 force_inline void operator()(T*begin)const noexcept(nothrow<T>){
5772 base_call(begin,_size);
5773 }
5774 };
5775
5776 [[nodiscard]]force_inline constexpr array_destruct_t operator[](size_t size)const noexcept{return{size};}
5777
5778 struct not_t{};
5779 /*适用于unget(this,not destruct);*/
5780 force_inline constexpr not_t operator!()const noexcept{return not_t{};}
5781 }destruct{};
5782
5795 constexpr struct re_construct_t{
5796 template<class T,class...Args>
5797 static constexpr bool able=destruct.able<T>&&construct<T>.able<Args...>;
5798 template<class T,class...Args>
5799 static constexpr bool nothrow=destruct.nothrow<T>&&construct<T>.nothrow<Args...>;
5800 template<class T,class...Args>
5801 static constexpr bool trivial=destruct.trivial<T>&&construct<T>.trivial<Args...>;
5802
5803 template<class T> requires able<T>
5804 force_inline T* operator()(T*to)const noexcept(nothrow<T>){
5805 destruct(to);
5806 construct<T>[to]();
5807 return to;
5808 }
5809 template<class T>
5812 size_t _size;
5813 template<class...Args> requires able<T,Args...>
5814 T* operator()(Args&&...rest)const noexcept(nothrow<T,Args...>){
5815 if constexpr(type_info<T>.has_attribute(never_in_array))
5816 template_error("You cannot perform array operations on never_in_array type.");
5817 destruct[_size](_to);
5818 construct<T>[_to][_size](forward<Args>(rest)...);
5819 return _to;
5820 }
5821 };
5822 template<class T>
5825 template<class...Args> requires able<T,Args...>
5826 T* operator()(Args&&...rest)const noexcept(nothrow<T,Args...>){
5827 destruct(_to);
5828 construct<T>[_to](forward<Args>(rest)...);
5829 return _to;
5830 }
5831 [[nodiscard]]force_inline constexpr array_re_construct_t<T> operator[](size_t size)const noexcept{return{_to,size};}
5832 };
5833 template<class T>
5834 [[nodiscard]]force_inline constexpr placement_re_construct_t<T> operator[](T*p)const noexcept{return{p};}
5835 }re_construct;
5836
5837 constexpr struct copy_construct_t{
5838 template<class T>
5839 static constexpr bool r_able=copy_construct_able<T>?
5840 copy_construct_trivial<T>||!(construct<T>.trivial<>&&copy_assign_trivial<T>)
5841 :false;//trivial操作优先考虑
5842 template<class T>
5843 static constexpr bool able=r_able<T>?true:(construct<T>.able<>&&copy_assign_able<T>);
5844 template<class T>
5845 static constexpr bool nothrow=r_able<T>?copy_construct_nothrow<T>:
5846 (construct<T>.nothrow<>&&copy_assign_nothrow<T>);
5847 template<class T>
5848 static constexpr bool trivial=r_able<T>?copy_construct_trivial<T>:
5849 (construct<T>.trivial<>&&copy_assign_trivial<T>);
5850
5851 template<class T> requires able<T>
5852 static T*base_call(T*to,const T*from)noexcept(nothrow<T>){
5853 if constexpr(trivial<T>)
5854 return reinterpret_cast<T*>(::std::memcpy(to,add_const(from),sizeof(T)));
5855 else{
5856 if constexpr(r_able<T>)
5857 new(to)T(*from);
5858 else{
5859 construct<T>[to]();
5860 *to=*from;
5861 }
5862 return to;
5863 }
5864 }
5865
5866 template<class T> requires able<T>
5867 static T*base_call(T*to,const T*from,size_t size)noexcept(nothrow<T>){
5868 if constexpr(trivial<T>)
5869 return reinterpret_cast<T*>(::std::memcpy(to,add_const(from),sizeof(T)*size));
5870 else{
5871 while(size--)
5872 base_call(to+size,from+size);
5873 return to;
5874 }
5875 }
5876
5877 template<class T> requires able<T>
5878 force_inline T*operator()(T*to,const T*from)const noexcept(nothrow<T>)
5879 {return base_call(to,from);}
5880
5881 template<class T> requires able<T>
5883 {return base_call(to(),from());}
5884
5885 template<class T> requires able<T>
5887 {return base_call(to(),from());}
5888
5889
5890 template<class T> requires able<T>
5891 force_inline T*operator()(T*to,const T*from,size_t size)const noexcept(nothrow<T>)
5892 {return base_call(to,from,size);}
5893
5894 template<class T> requires able<T>
5895 force_inline T*operator()(note::to_t<T*>to,note::from_t<const T*>from,size_t size)const noexcept(nothrow<T>)
5896 {return base_call(to(),from(),size);}
5897
5898 template<class T> requires able<T>
5899 force_inline T*operator()(note::from_t<const T*>from,note::to_t<T*>to,size_t size)const noexcept(nothrow<T>)
5900 {return base_call(to(),from(),size);}
5901
5902 template<class T> requires able<T>
5903 static T*base_call(T*to,const T&from)noexcept(nothrow<T>){
5904 if constexpr(r_able<T>)
5905 construct<T>[to](from);
5906 else{
5907 construct<T>[to]();
5908 *to=from;
5909 }
5910 return to;
5911 }
5912
5913 template<class T> requires able<T>
5914 static T*base_call(T*to,const T&from,size_t size)noexcept(nothrow<T>){
5915 if constexpr(type_info<T>.has_attribute(never_in_array))
5916 template_error("You cannot perform array operations on never_in_array type.");
5917 if constexpr(::std::is_trivially_copyable_v<T>)
5919 else
5920 while(size--)
5921 base_call(to+size,from);
5922 return to;
5923 }
5924
5925 template<class T> requires able<T>
5926 force_inline T*operator()(T*to,const T&from)const noexcept(nothrow<T>)
5927 {return base_call(to,from);}
5928
5930 size_t _size;
5931 template<class T> requires able<T>
5932 force_inline T*operator()(T*to,const T*from)const noexcept(nothrow<T>){
5933 return base_call(to,from,_size);
5934 }
5935 template<class T> requires able<T>
5936 force_inline T*operator()(T*to,const T&from)const noexcept(nothrow<T>){
5937 return base_call(to,from,_size);
5938 }
5939 template<class T> requires able<T>
5941 return operator()(to(),from());
5942 }
5943 template<class T> requires able<T>
5945 return operator()(to(),from());
5946 }
5947 };
5948 [[nodiscard]]force_inline constexpr array_copy_construct_t operator[](size_t a)const noexcept{return{a};}
5949 }copy_construct{};
5950
5951 constexpr struct move_construct_t{
5952 template<class T>
5953 static constexpr bool r_able=move_construct_able<T>?
5954 move_construct_trivial<T>||!copy_construct.trivial<T>
5955 :false;//trivial操作优先考虑
5956 template<class T>
5957 static constexpr bool able=r_able<T>?true:copy_construct.able<T>;
5958 template<class T>
5959 static constexpr bool nothrow=r_able<T>?move_construct_nothrow<T>:
5961 template<class T>
5962 static constexpr bool trivial=r_able<T>?move_construct_trivial<T>:
5964
5965 template<class T> requires able<T>
5966 static T*base_call(T*to,T*from)noexcept(nothrow<T>){
5967 if constexpr(trivial<T>)
5968 return reinterpret_cast<T*>(::std::memcpy(to,add_const(from),sizeof(T)));
5969 else{
5970 if constexpr(r_able<T>){
5971 construct<T>[to](::std::move(*from));
5972 return to;
5973 }else
5974 return copy_construct(to,from);
5975 }
5976 }
5977 template<class T> requires able<T>
5978 static T*base_call(T*to,T*from,size_t size)noexcept(nothrow<T>){
5979 if constexpr(type_info<T>.has_attribute(never_in_array))
5980 template_error("You cannot perform array operations on never_in_array type.");
5981 if constexpr(trivial<T>)
5982 return reinterpret_cast<T*>(::std::memcpy(to,add_const(from),sizeof(T)*size));
5983 else{
5984 if constexpr(r_able<T>){
5985 while(size--)
5986 construct<T>[to+size](::std::move(from[size]));
5987 return to;
5988 }else
5989 return copy_construct[size](to,from);
5990 }
5991 }
5992
5993 template<class T> requires able<T>
5994 force_inline T*operator()(T*to,T*from)const noexcept(nothrow<T>)
5995 {return base_call(to,from);}
5996
5997 template<class T> requires able<T>
5998 force_inline T*operator()(note::to_t<T*>to,note::from_t<T*>from)const noexcept(nothrow<T>)
5999 {return base_call(to(),from());}
6000
6001 template<class T> requires able<T>
6002 force_inline T*operator()(note::from_t<T*>from,note::to_t<T*>to)const noexcept(nothrow<T>)
6003 {return base_call(to(),from());}
6004
6006 size_t _size;
6007 template<class T> requires able<T>
6008 force_inline T*operator()(T*to,T*from)const noexcept(nothrow<T>){
6009 return base_call(to,from,_size);
6010 }
6011 template<class T> requires able<T>
6012 force_inline T*operator()(note::to_t<T*>to,note::from_t<T*>from)const noexcept(nothrow<T>){
6013 return operator()(to(),from());
6014 }
6015 template<class T> requires able<T>
6016 force_inline T*operator()(note::from_t<T*>from,note::to_t<T*>to)const noexcept(nothrow<T>){
6017 return operator()(to(),from());
6018 }
6019 };
6020 [[nodiscard]]force_inline constexpr array_move_construct_t operator[](size_t a)const noexcept{return{a};}
6021 }move_construct{};
6022
6023 constexpr struct move_t{
6024 template<class T>
6025 static constexpr bool able=move_construct.able<T>&&destruct.able<T>;
6026 template<class T>
6027 static constexpr bool nothrow=move_construct.nothrow<T>&&destruct.nothrow<T>;
6028 template<class T>
6029 static constexpr bool trivial=move_construct.trivial<T>&&destruct.trivial<T>;
6030
6031 template<class T> requires able<T>
6032 static T*base_call(T*to,T*from)noexcept(nothrow<T>){
6033 move_construct(to,from);
6034 destruct(from);
6035 return to;
6036 }
6037 template<class T> requires able<T>
6038 static T*base_call(T*to,T*from,size_t size)noexcept(nothrow<T>){
6039 if constexpr(type_info<T>.has_attribute(never_in_array))
6040 template_error("You cannot perform array operations on never_in_array type.");
6041 move_construct[size](to,from);
6042 destruct[size](from);
6043 return to;
6044 }
6045
6046 template<class T> requires able<T>
6047 force_inline T*operator()(T*to,T*from)const noexcept(nothrow<T>)
6048 {return base_call(to,from);}
6049
6050 template<class T> requires able<T>
6051 force_inline T*operator()(note::to_t<T*>to,note::from_t<T*>from)const noexcept(nothrow<T>)
6052 {return base_call(to(),from());}
6053
6054 template<class T> requires able<T>
6055 force_inline T*operator()(note::from_t<T*>from,note::to_t<T*>to)const noexcept(nothrow<T>)
6056 {return base_call(to(),from());}
6057
6059 size_t _size;
6060 template<class T> requires able<T>
6061 force_inline T*operator()(T*to,T*from)const noexcept(nothrow<T>){
6062 return base_call(to,from,_size);
6063 }
6064 template<class T> requires able<T>
6065 force_inline T*operator()(note::to_t<T*>to,note::from_t<T*>from)const noexcept(nothrow<T>){
6066 return operator()(to(),from());
6067 }
6068 template<class T> requires able<T>
6069 force_inline T*operator()(note::from_t<T*>from,note::to_t<T*>to)const noexcept(nothrow<T>){
6070 return operator()(to(),from());
6071 }
6072 };
6073 [[nodiscard]]force_inline constexpr array_move_t operator[](size_t a)const noexcept{return{a};}
6074
6075 //特殊使用
6076 template<class T>
6077 [[nodiscard]]constexpr remove_ref<T>&& operator()(T&&a)const noexcept{
6078 return static_cast<remove_ref<T>&&>(a);
6079 }
6080 }move{};
6081
6082 constexpr struct copy_t{
6083 //特殊使用
6084 //UF
6085 template<class T> requires(copy_construct.able<T>)
6086 [[nodiscard]]constexpr T operator()(const T&a)const noexcept{
6087 return copy_construct<T>(a);
6088 }
6089 }copy{};
6090
6091 constexpr struct copy_assign_t{
6092 template<class T>
6093 static constexpr bool r_able=copy_assign_able<T>?
6094 copy_assign_trivial<T>||!(copy_construct_trivial<T>&&destruct.trivial<T>)
6095 :false;//trivial操作优先考虑
6096 template<class T>
6097 static constexpr bool able=r_able<T>?true:(copy_construct_able<T>&&destruct.able<T>);
6098 template<class T>
6099 static constexpr bool nothrow=r_able<T>?copy_assign_nothrow<T>:
6100 (copy_construct_nothrow<T>&&destruct.nothrow<T>);
6101 template<class T>
6102 static constexpr bool trivial=r_able<T>?copy_assign_trivial<T>:
6103 (copy_construct_trivial<T>&&destruct.trivial<T>);
6104
6105 template<class T> requires able<T>
6106 static T& base_call(T&a,const T&b)noexcept(nothrow<T>){
6107 if constexpr(r_able<T>)
6108 a=b;
6109 else{
6110 destruct(&a);
6111 construct<T>[&a](b);
6112 }
6113 return a;
6114 }
6115 template<class T> requires able<T>
6116 static T* base_call(T*to,const T*from,size_t size)noexcept(nothrow<T>){
6117 if constexpr(trivial<T>)
6118 ::std::memcpy(to,add_const(from),size*sizeof(T));
6119 else{
6120 while(size--)
6121 base_call(to[size],from[size]);
6122 }
6123 return to;
6124 }
6125 template<class T> requires able<T>
6126 static T* base_call(T* to,const T& from,size_t size)noexcept(nothrow<T>){
6127 if constexpr(trivial<T>)
6129 else
6130 while(size--)
6131 base_call(to[size],from);
6132 return to;
6133 }
6134
6135 template<class T> requires able<T>
6136 force_inline T& operator()(T&a,const T&b)const noexcept(nothrow<T>){
6137 return base_call(a,b);
6138 }
6139
6141 size_t _size;
6142 template<class T> requires able<T>
6143 force_inline T*operator()(T*to,const T*from)const noexcept(nothrow<T>){
6144 return base_call(to,from,_size);
6145 }
6146 template<class T> requires able<T>
6148 return operator()(to(),from());
6149 }
6150 template<class T> requires able<T>
6152 return operator()(to(),from());
6153 }
6154 template<class T> requires able<T>
6155 force_inline T*operator()(const T&from,note::to_t<T*>to)const noexcept(nothrow<T>){
6156 return base_call(to(),from,_size);
6157 }
6158 template<class T> requires able<T>
6159 force_inline T*operator()(note::to_t<T*>to,const T&from)const noexcept(nothrow<T>){
6160 return base_call(to(),from,_size);
6161 }
6162 };
6163 [[nodiscard]]force_inline constexpr array_copy_assign_t operator[](size_t a)const noexcept{return{a};}
6164 }copy_assign{};
6165
6166 constexpr struct move_assign_t{
6167 template<class T>
6168 static constexpr bool r_able=move_assign_able<T>;
6169 template<class T>
6170 static constexpr bool able=r_able<T>?true:copy_assign.able<T>;
6171 template<class T>
6172 static constexpr bool nothrow=r_able<T>?move_assign_nothrow<T>:copy_assign.nothrow<T>;
6173 template<class T>
6174 static constexpr bool trivial=r_able<T>?move_assign_trivial<T>:copy_assign.trivial<T>;
6175
6176 template<class T> requires able<T>
6177 static T& base_call(T&a,T&&b)noexcept(nothrow<T>){
6178 if constexpr(r_able<T>)
6179 a=move(b);
6180 else{
6181 copy_assign(a,b);
6182 }
6183 return a;
6184 }
6185 template<class T> requires able<T>
6186 static T* base_call(T*to,T*from,size_t size)noexcept(nothrow<T>){
6187 if constexpr(trivial<T>)
6188 ::std::memcpy(to,add_const(from),size*sizeof(T));
6189 else{
6190 while(size--)
6191 base_call(to[size],from[size]);
6192 }
6193 return to;
6194 }
6195
6196 template<class T> requires able<T>
6197 force_inline T& operator()(T&a,T&b)const noexcept(nothrow<T>){
6198 return base_call(a,move(b));
6199 }
6200
6202 size_t _size;
6203 template<class T> requires able<T>
6204 force_inline T*operator()(T*to,T*from)const noexcept(nothrow<T>){
6205 return base_call(to,from,_size);
6206 }
6207 template<class T> requires able<T>
6208 force_inline T*operator()(note::to_t<T*>to,note::from_t<T*>from)const noexcept(nothrow<T>){
6209 return operator()(to(),from());
6210 }
6211 template<class T> requires able<T>
6212 force_inline T*operator()(note::from_t<T*>from,note::to_t<T*>to)const noexcept(nothrow<T>){
6213 return operator()(to(),from());
6214 }
6215 };
6216 [[nodiscard]]force_inline constexpr array_move_assign_t operator[](size_t a)const noexcept{return{a};}
6217 }move_assign{};
6218 }
6219
6220 //file_end
6221
6222 #line 9 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/lifetime/_body.hpp"
6223 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/lifetime/_export.hpp"
6224 //_export.hpp
6225 //at namespace elc::defs::memory
6226 /*
6227 未完成的elc解释器base文件
6228 由steve02081504与Alex0125设计、编写
6229 转载时请在不对此文件做任何修改的同时注明出处
6230 项目地址:https://github.com/steve02081504/ELC
6231 */
6232 #define export using lifetime_n::
6233 export construct;
6234 export destruct;
6235 export re_construct;
6236 export copy_assign;
6237 export move_assign;
6238 export move;
6239 export copy;
6240 export copy_construct;
6241 export move_construct;
6242 #undef export
6243
6244 //file_end
6245
6246 #line 10 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/lifetime/_body.hpp"
6247 #if defined(ELC_TEST_ON)
6248 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/lifetime/_test.hpp"
6249 //_test.hpp
6250 //at namespace elc::defs::memory
6251 /*
6252 未完成的elc解释器base文件
6253 由steve02081504与Alex0125设计、编写
6254 转载时请在不对此文件做任何修改的同时注明出处
6255 项目地址:https://github.com/steve02081504/ELC
6256 */
6257 namespace lifetime_n{
6258 //BLOCK:for debug
6259 inline void test(){
6260 ELC_TEST_EVENTNAME("lifetime部分测试");
6261 }
6262 inline void test_log_out(){
6263 }
6264 inline void test_end(){
6265 }
6266 //BLOCK_END
6267 }
6268
6269 //file_end
6270
6271 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/lifetime/_body.hpp"
6272 #endif
6273
6274 //file_end
6275
6276 #line 23 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/_body.hpp"
6277 }
6278 namespace base{
6279 //依赖lifetime
6280 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/tools/_body.hpp"
6281 //_body.hpp
6282 //at namespace elc::defs::base
6283 /*
6284 未完成的elc解释器base文件
6285 由steve02081504与Alex0125设计、编写
6286 转载时请在不对此文件做任何修改的同时注明出处
6287 项目地址:https://github.com/steve02081504/ELC
6288 */
6289 //D?
6290 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/tools/flag.hpp"
6291 //flag.hpp
6292 //at namespace elc::defs::base
6293 /*
6294 未完成的elc解释器base文件
6295 由steve02081504与Alex0125设计、编写
6296 转载时请在不对此文件做任何修改的同时注明出处
6297 项目地址:https://github.com/steve02081504/ELC
6298 */
6299 /*
6300 表示flag是否被设置的enum字面量.
6301 */
6302 enum flag_set_type:bool{seted=true,not_set=false};
6303 /*
6304 bool的简易包装以表示『是否被设置』,无法使用operator=,因为不应如此.
6305 */
6306 class flag{
6307 bool _m;
6308 public:
6309 constexpr explicit flag(flag_set_type a=not_set)noexcept:_m(bool(a)){}
6310 [[nodiscard]]explicit operator bool()const noexcept{return _m;}
6311 flag(flag&a)noexcept:_m((bool)a){}
6312 flag(flag&&a)noexcept:_m((bool)a){}
6313 inline void operator=(flag&)&noexcept=delete;
6314 inline void operator=(flag&&)&noexcept=delete;
6315 inline void set()noexcept{_m=true;}
6316 inline void unset()noexcept{_m=false;}
6317 };
6318
6319 //file_end
6320
6321 #line 10 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/tools/_body.hpp"
6322 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/tools/mark_type.hpp"
6323 //mark_type.hpp
6324 //at namespace elc::defs::base
6325 /*
6326 未完成的elc解释器base文件
6327 由steve02081504与Alex0125设计、编写
6328 转载时请在不对此文件做任何修改的同时注明出处
6329 项目地址:https://github.com/steve02081504/ELC
6330 */
6331 /*
6332 表明是否被标记的enum字面量.
6333 */
6334 enum mark_type:bool{marked=true,not_mark=false};
6335 /*
6336 用于gc的可达性分析的普通模板式elc属性.
6337 */
6338 template<typename T>
6340 mutable flag _m;
6341 public:
6342 constexpr explicit mark_able(mark_type a=not_mark)noexcept:_m(a==not_mark?not_set:seted){};
6343 inline void mark()const noexcept{_m.set();}
6344 inline void unmark()const noexcept{_m.unset();}
6345 [[nodiscard]]bool was_marked()const noexcept{return(bool)_m;}
6346 };
6347
6348 //file_end
6349
6350 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/tools/_body.hpp"
6351
6352 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/tools/iterator.hpp"
6353 //iterator.hpp
6354 //at namespace elc::defs::base
6355 /*
6356 未完成的elc解释器base文件
6357 由steve02081504与Alex0125设计、编写
6358 转载时请在不对此文件做任何修改的同时注明出处
6359 项目地址:https://github.com/steve02081504/ELC
6360 */
6361 namespace iterator_n{
6362 using namespace memory;//copy_assign、move_assign
6363 template<typename base_t_w>
6368 template<typename build_base_t_T> requires(construct<base_t_rw>.able<build_base_t_T>)
6369 constexpr reverse_base_t(build_base_t_T&& a)noexcept(construct<base_t_rw>.nothrow<build_base_t_T>):_m(a){}
6370 [[nodiscard]]auto get_before()noexcept_as(declvalue(base_t_w).get_next()){ return ((base_t_w&)_m).get_next(); }
6371 [[nodiscard]]auto get_next()noexcept_as(declvalue(base_t_w).get_before()){ return ((base_t_w&)_m).get_before(); }
6372 [[nodiscard]]auto get_handle()noexcept_as(declvalue(base_t_w).get_handle()){ return ((base_t_w&)_m).get_handle(); }
6373 };
6374 template<typename base_t> requires(compare.able<base_t>)
6375 [[nodiscard]]auto operator<=>(const reverse_base_t<base_t>&a,const reverse_base_t<base_t>&b)noexcept(compare.nothrow<base_t>){
6376 return compare((const base_t&)b._m,(const base_t&)a._m);
6377 }
6378 template<typename base_t,typename T> requires(compare.able<T,base_t> && type_info<remove_cvref<T>> != type_info<reverse_base_t<base_t>::base_t_rw>)
6379 [[nodiscard]]auto operator<=>(const reverse_base_t<base_t>& a,T&& b)noexcept(compare.nothrow<T,base_t>){
6380 return compare(b,(const base_t&)a._m);
6381 }
6382 template<typename base_t,typename T> requires(compare.able<base_t,T> && type_info<remove_cvref<T>> != type_info<reverse_base_t<base_t>::base_t_rw>)
6383 [[nodiscard]]auto operator<=>(T&& a,const reverse_base_t<base_t>& b)noexcept(compare.nothrow<base_t,T>){
6384 return compare((const base_t&)b._m,a);
6385 }
6386 template<typename base_t,typename T> requires(equal.able<T,base_t>)
6387 [[nodiscard]]auto operator==(const reverse_base_t<base_t>& a,T&& b)noexcept(equal.nothrow<T,base_t>){
6388 return equal(b,(const base_t&)a._m);
6389 }
6390 template<typename base_t,typename T> requires(equal.able<base_t,T>)
6391 [[nodiscard]]auto operator==(T&& a,const reverse_base_t<base_t>& b)noexcept(equal.nothrow<base_t,T>){
6392 return equal((const base_t&)b._m,a);
6393 }
6394
6395 template<typename value_t,typename base_t_w>
6397 template<typename,typename>
6398 friend class same_base_t;
6399 protected:
6402 //
6403 mutable base_t_rw _m;
6404 //
6405 [[nodiscard]]static constexpr bool is_handle_getter_noexcept()noexcept{
6406 if constexpr(type_info<::std::remove_pointer_t<base_t_w>> == type_info<value_t>)
6407 return true;
6408 elseif constexpr(was_not_an_ill_form(declvalue(base_t_w)->get_handle()))
6409 return noexcept(declvalue(base_t_w)->get_handle());
6410 elseif constexpr(was_not_an_ill_form(declvalue(base_t_w).get_handle()))
6411 return noexcept(declvalue(base_t_w).get_handle());
6412 }
6413 [[nodiscard]]inline value_t*handle_getter()const noexcept(is_handle_getter_noexcept()){
6414 if constexpr(type_info<::std::remove_pointer_t<base_t_w>> == type_info<value_t>)
6415 return ((base_t_w)_m);
6416 elseif constexpr(was_not_an_ill_form(declvalue(base_t_w)->get_handle()))
6417 return ((base_t_w)_m)->get_handle();
6418 elseif constexpr(was_not_an_ill_form(declvalue(base_t_w).get_handle()))
6419 return ((base_t_w)_m).get_handle();
6420 }
6421 //
6422 [[nodiscard]]static constexpr bool is_value_getter_noexcept()noexcept{
6423 if constexpr(type_info<::std::remove_pointer_t<base_t_w>> == type_info<value_t>)
6424 return true;
6425 elseif constexpr(was_not_an_ill_form(declvalue(base_t_w)->get_value()))
6426 return noexcept(declvalue(base_t_w)->get_value());
6427 elseif constexpr(was_not_an_ill_form(declvalue(base_t_w).get_value()))
6428 return noexcept(declvalue(base_t_w).get_value());
6429 }
6430
6431 [[nodiscard]]static constexpr auto value_type_getter(){
6432 if constexpr(type_info<::std::remove_pointer_t<base_t_w>> == type_info<value_t>)
6433 return type_info<decltype(*((base_t_w)_m))>;
6434 elseif constexpr(was_not_an_ill_form(declvalue(base_t_w)->get_value()))
6435 return type_info<decltype(((base_t_w)_m)->get_value())>;
6436 elseif constexpr(was_not_an_ill_form(declvalue(base_t_w).get_value()))
6437 return type_info<decltype(((base_t_w)_m).get_value())>;
6438 else
6439 return type_info<decltype(*declvalue(value_t*))>;
6440 }
6441 typedef decltype(value_type_getter())::template_name type value_type;
6442
6443 [[nodiscard]]inline value_type value_getter()const noexcept(is_handle_getter_noexcept()){
6444 if constexpr(type_info<::std::remove_pointer_t<base_t_w>> == type_info<value_t>)
6445 return *((base_t_w)_m);
6446 elseif constexpr(was_not_an_ill_form(declvalue(base_t_w)->get_value()))
6447 return ((base_t_w)_m)->get_value();
6448 elseif constexpr(was_not_an_ill_form(declvalue(base_t_w).get_value()))
6449 return ((base_t_w)_m).get_value();
6450 else
6451 return *handle_getter();
6452 }
6453 //
6454 [[nodiscard]]static constexpr bool is_next_getter_noexcept()noexcept{
6455 if constexpr(type_info<::std::remove_pointer_t<base_t_w>> == type_info<value_t>)
6456 return true;
6457 elseif constexpr(was_not_an_ill_form(declvalue(base_t_w)->get_next()))
6458 return noexcept(declvalue(base_t_w)->get_next());
6459 elseif constexpr(was_not_an_ill_form(declvalue(base_t_w).get_next()))
6460 return noexcept(declvalue(base_t_w).get_next());
6461 }
6462 [[nodiscard]]inline base_t_w next_getter()const noexcept(is_next_getter_noexcept()){
6463 if constexpr(type_info<::std::remove_pointer_t<base_t_w>> == type_info<value_t>)
6464 return ((base_t_w)_m)+1;
6465 elseif constexpr(was_not_an_ill_form(declvalue(base_t_w)->get_next()))
6466 return ((base_t_w)_m)->get_next();
6467 elseif constexpr(was_not_an_ill_form(declvalue(base_t_w).get_next()))
6468 return ((base_t_w)_m).get_next();
6469 }
6470 //
6471 [[nodiscard]]static constexpr bool is_before_getter_noexcept()noexcept{
6472 if constexpr(type_info<::std::remove_pointer_t<base_t_w>> == type_info<value_t>)
6473 return true;
6474 elseif constexpr(was_not_an_ill_form(declvalue(base_t_w)->get_before()))
6475 return noexcept(declvalue(base_t_w)->get_before());
6476 elseif constexpr(was_not_an_ill_form(declvalue(base_t_w).get_before()))
6477 return noexcept(declvalue(base_t_w).get_before());
6478 }
6479 [[nodiscard]]inline base_t_w before_getter()const noexcept(is_before_getter_noexcept()){
6480 if constexpr(type_info<::std::remove_pointer_t<base_t_w>> == type_info<value_t>)
6481 return ((base_t_w)_m)-1;
6482 elseif constexpr(was_not_an_ill_form(declvalue(base_t_w)->get_before()))
6483 return ((base_t_w)_m)->get_before();
6484 elseif constexpr(was_not_an_ill_form(declvalue(base_t_w).get_before()))
6485 return ((base_t_w)_m).get_before();
6486 }
6487 public:
6489 //
6490 constexpr same_base_t()noexcept=default;
6491 template<typename build_base_t_T> requires(construct<base_t_rw>.able<build_base_t_T>)
6492 constexpr same_base_t(build_base_t_T&&a)noexcept(construct<base_t_rw>.nothrow<build_base_t_T>):_m(a){}
6493 constexpr same_base_t(const this_t&a)noexcept(construct<base_t_rw>.nothrow<const base_t_rw>):_m(a._m){}
6494 constexpr same_base_t(this_t&&a)noexcept_as(declvalue(this_t).swap_with(a)){swap_with(a);}
6495 template<typename other_T,typename other_base_t> requires(construct<base_t_rw>.able<other_base_t>)
6496 constexpr same_base_t(const same_base_t<other_T,other_base_t>&a)noexcept(construct<base_t_rw>.nothrow<other_base_t>):_m(a._m){}
6497 ~same_base_t()noexcept(destruct.nothrow<base_t_rw>)=default;
6498 [[nodiscard]]constexpr bool operator==(const this_t& a)const noexcept_as(declvalue(base_t_rw) == declvalue(base_t_rw)){ return _m == a._m; }
6499 [[nodiscard]]constexpr value_t* operator->()noexcept(is_handle_getter_noexcept()){ return handle_getter(); }
6500 [[nodiscard]]constexpr value_type operator*()noexcept_as(is_value_getter_noexcept()){ return value_getter(); }
6501 [[nodiscard]]constexpr operator value_t*()noexcept_as(declvalue(this_t).operator->()){ return operator->(); }
6502 [[nodiscard]]constexpr bool operator==(value_t* a)const noexcept(is_handle_getter_noexcept()&&noexcept(pointer_equal(declvalue(value_t*),declvalue(value_t*)))){ return pointer_equal(handle_getter(),a); }
6503 template<typename other_value_t,typename other_base_t_w> requires(equal.able<base_t_rw,other_base_t_w>)
6504 [[nodiscard]]constexpr bool operator==(const same_base_t<other_value_t,other_base_t_w>& a)const noexcept(equal.nothrow<base_t_rw,other_base_t_w>){
6505 return equal(_m,a._m);
6506 }
6507 template<typename other_value_t,typename other_base_t_w>
6508 [[nodiscard]]constexpr auto operator<=>(const same_base_t<other_value_t,other_base_t_w>& a)const noexcept(compare.nothrow<base_t_rw,other_base_t_w>){
6509 if constexpr(compare.able<base_t_rw,other_base_t_w>)
6510 return compare(_m,a._m);
6511 }
6512 };
6513 template<typename value_t,typename base_t_w>
6515 {a.swap_with(b);}
6516
6517 template<typename value_t,typename base_t_w>
6518 struct base_iterator_t:same_base_t<value_t,base_t_w>{
6521 protected:
6522 using base_t::is_before_getter_noexcept;
6523 using base_t::is_next_getter_noexcept;
6524 using base_t::before_getter;
6525 using base_t::next_getter;
6527 public:
6528 using base_t::base_t;
6529 constexpr this_t&operator=(const base_t_rw&a)&noexcept(copy_assign.nothrow<base_t_rw>){copy_assign(base_t::_m,a);return*this;}
6530 constexpr this_t&operator=(base_t_rw&&a)&noexcept(move_assign.nothrow<base_t_rw>){move_assign(base_t::_m,a);return*this;}
6531 constexpr this_t&operator++()&noexcept(is_next_getter_noexcept()){return*this=next_getter();}
6532 constexpr this_t&operator--()&noexcept(is_before_getter_noexcept()){return*this=before_getter();}
6533 constexpr this_t operator++(int)&noexcept_as(this_t(++declvalue(this_t&))){auto a=*this;operator++();return a;}
6534 constexpr this_t operator--(int)&noexcept_as(this_t(--declvalue(this_t&))){auto a=*this;operator--();return a;}
6535 constexpr this_t operator+(ptrdiff_t num)const noexcept_as(this_t(--declvalue(this_t&)),++declvalue(this_t&)){
6536 if constexpr(type_info<::std::remove_pointer_t<base_t_w>> == type_info<value_t>)
6537 return base_t::_m+num;
6538 else{
6539 auto a=*this;
6540 if(num>0)
6541 while(num--)
6542 ++a;
6543 else
6544 while(num++)
6545 --a;
6546 return a;
6547 }
6548 }
6549 constexpr this_t operator-(ptrdiff_t num)const noexcept_as(declvalue(this_t&)+0){ return *this+(-num); }
6550 };
6551 template<typename value_t,typename base_t_w>
6553 template<typename value_t,typename base_t_w>
6555
6556 template<typename value_t,typename base_t_w=value_t*>
6558 template<typename value_t,typename base_t_w=const value_t*>
6560 template<typename value_t,typename base_t_w=value_t*>
6562 template<typename value_t,typename base_t_w=const value_t*>
6564 }
6570
6571 //file_end
6572
6573 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/tools/_body.hpp"
6574 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/tools/list.hpp"
6575 //list.hpp
6576 //at namespace elc::defs::base
6577 /*
6578 未完成的elc解释器base文件
6579 由steve02081504与Alex0125设计、编写
6580 转载时请在不对此文件做任何修改的同时注明出处
6581 项目地址:https://github.com/steve02081504/ELC
6582 */
6583 //copy from old ELC
6584 template<typename T>
6585 class list_t;
6586 /*
6587 common attribute,表明这是对于list_t可加入的cons.
6588 */
6589 template<typename T>
6592 private:
6593 friend list_t<T>;
6594 friend iterator_t<T,this_t*>::base_t;
6596
6597 mutable this_t*_before;//为了在析构时修改前一项的next,勿删
6598 mutable this_t*_next;
6599
6600 [[nodiscard]]this_t*get_before()noexcept{return _before;}
6601 [[nodiscard]]this_t*get_next()noexcept{return _next;}
6602
6603 constexpr cons_t(this_t*a,this_t*b):_before(a),_next(b){}
6604
6605 constexpr void set_before(this_t*a){
6606 _before=a;
6607 a->_next=this;
6608 }
6609 constexpr void set_next(this_t*a){
6610 _next=a;
6611 a->_before=this;
6612 }
6613 constexpr void insert_to_before(this_t*a){
6614 set_before(a->_before);
6615 set_next(a);
6616 }
6617 constexpr void bind_with(this_t*a)noexcept{
6618 set_next(a);
6619 set_before(a);
6620 }
6621 constexpr void remove_from_list()noexcept{
6622 _before->set_next(_next);
6623 }
6624 [[nodiscard]]constexpr T*get_handle(){
6625 return attribute_t::get_handle();
6626 }
6627 public:
6628 constexpr cons_t()=default;
6630 remove_from_list();
6631 }
6632 };
6633 /*
6634 T类型的有序双向list.
6635 方法有:
6636 constexpr void add(cons_t<T>*a)noexcept;
6637 constexpr iterator begin()noexcept;
6638 constexpr iterator end()noexcept;
6639 constexpr iterator head()noexcept;
6640 constexpr bool empty()const noexcept;
6641 */
6642 template<typename T>
6643 struct list_t{
6646 typedef iterator_t<T,cons*>iterator;
6647 private:
6648 cons _begin,_end;
6649 public:
6650 constexpr list_t()noexcept{_begin.bind_with(&_end);}
6651 inline constexpr void add(cons*a)noexcept{
6652 a->insert_to_before(&_end);
6653 }
6654 [[nodiscard]]constexpr iterator begin()noexcept{return _begin.get_next();}//这叫头迭代器
6655 [[nodiscard]]constexpr iterator end()noexcept{return&_end;}//这叫超尾迭代器
6656 [[nodiscard]]constexpr iterator head()noexcept{return&_begin;}//。。。。这个大概就是超头迭代器了😂
6657 [[nodiscard]]constexpr bool empty()const noexcept{return _begin.get_next()==&_end;}
6658 };
6659
6660 //file_end
6661
6662 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/tools/_body.hpp"
6663
6664 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/tools/function_base.hpp"
6665 //function_base.hpp
6666 //at namespace elc::defs::container
6667 /*
6668 未完成的elc解释器base文件
6669 由steve02081504与Alex0125设计、编写
6670 转载时请在不对此文件做任何修改的同时注明出处
6671 项目地址:https://github.com/steve02081504/ELC
6672 */
6673 namespace function_base_n{
6674 #if !defined(_MSC_VER)
6675 template<typename>
6677
6678 template<typename Ret_t,typename T,typename...Args_t,bool nothrow>
6679 struct function_type_getter_helper<Ret_t(T::*)(Args_t...)noexcept(nothrow)>
6680 {using type=Ret_t(Args_t...)noexcept(nothrow);};
6681
6682 template<typename Ret_t,typename T,typename...Args_t,bool nothrow>
6683 struct function_type_getter_helper<Ret_t(T::*)(Args_t...)&noexcept(nothrow)>
6684 {using type=Ret_t(Args_t...)noexcept(nothrow);};
6685
6686 template<typename Ret_t,typename T,typename...Args_t,bool nothrow>
6687 struct function_type_getter_helper<Ret_t(T::*)(Args_t...)const noexcept(nothrow)>
6688 {using type=Ret_t(Args_t...)noexcept(nothrow);};
6689
6690 template<typename Ret_t,typename T,typename...Args_t,bool nothrow>
6691 struct function_type_getter_helper<Ret_t(T::*)(Args_t...)const&noexcept(nothrow)>
6692 {using type=Ret_t(Args_t...)noexcept(nothrow);};
6693
6694 template<typename T>
6695 [[nodiscard]]constexpr auto function_type_getter_conditional_helper(){
6696 if constexpr(::std::is_function_v<T>)
6697 return type_info<T>;
6698 elseif constexpr(is_pointer<T> && ::std::is_function_v<::std::remove_pointer_t<T>>)//不支持多级函数指针:懒得写(其实挺简单的),而且function_t若支持多级函数指针的推导指引会很不安全
6699 return function_type_getter_conditional_helper<::std::remove_pointer_t<T>>();
6700 else
6701 return type_info<type_name function_type_getter_helper<decltype(&T::operator())>::type>;
6702 }
6703 template<typename T>
6705 typedef decltype(function_type_getter_conditional_helper<T>())::template_name type type;
6706 };
6707
6708 /*
6709 获取一个callable类型的“函数类型”
6710 如T(int)返回char,其函数类型便是char(int)
6711 */
6712 template<typename T>
6714
6715 /*
6716 用处:容纳一个callable类型(除过函数类型,但可以是其指针)并提供operator()
6717 小包装工具,能在意想不到的地方发挥效果(比如要额外携带数据的callable类型定义!见"../../lib_loader/lib_loader.hpp")
6718 */
6719 template<class T,class Func_t=get_function_type<T>>
6721 template<class T,bool nothrow,class Ret_t,class...Args_t>
6722 struct function_data_warpper_t<T,Ret_t(Args_t...)noexcept(nothrow)>{
6723 static_assert(!::std::is_function_v<T>);
6724
6726
6727 function_data_warpper_t(T a)noexcept(construct<T>.nothrow<T>):_value(a){}
6728 ~function_data_warpper_t()noexcept(destruct.nothrow<T>)=default;
6729 Ret_t operator()(Args_t...args)noexcept(nothrow || invoke<T>.nothrow<Args_t...>){
6730 //BLOCK:constexpr checks
6731 if constexpr(!invoke<T>.able<Args_t...>)
6732 template_error("this T can\'t becall as args.");
6733 if constexpr(was_an_ill_form(static_cast<Ret_t>(declvalue(T)(declvalue(Args_t)...))))
6734 template_error("the return type of T was wrong.");
6735 //BLOCK_END
6736 if constexpr(type_info<Ret_t> != type_info<void>)
6737 return _value(forward<Args_t>(args)...);
6738 else
6739 _value(forward<Args_t>(args)...);
6740 }
6741 Ret_t operator()(Args_t...args)const noexcept(nothrow || invoke<const T>.nothrow<Args_t...>) requires(invoke<const T>.able<Args_t...>){
6742 //BLOCK:constexpr checks
6743 if constexpr(!invoke<T>.able<Args_t...>)
6744 template_error("this T can\'t becall as args.");
6745 if constexpr(was_an_ill_form(static_cast<Ret_t>(declvalue(T)(declvalue(Args_t)...))))
6746 template_error("the return type of T was wrong.");
6747 //BLOCK_END
6748 if constexpr(type_info<Ret_t> != type_info<void>)
6749 return _value(forward<Args_t>(args)...);
6750 else
6751 _value(forward<Args_t>(args)...);
6752 }
6753 [[nodiscard]]auto&get_data()noexcept{return _value;}
6754 };
6755 #else
6756 //MSVC,我滴垃圾堆
6757 template<typename>
6758 struct function_type_getter_helper{};
6759
6760 template<typename Ret_t,typename T,typename...Args_t>
6761 struct function_type_getter_helper<Ret_t(T::*)(Args_t...)>
6762 {using type=Ret_t(Args_t...);};
6763
6764 template<typename Ret_t,typename T,typename...Args_t>
6765 struct function_type_getter_helper<Ret_t(T::*)(Args_t...)&>
6766 {using type=Ret_t(Args_t...);};
6767
6768 template<typename Ret_t,typename T,typename...Args_t>
6769 struct function_type_getter_helper<Ret_t(T::*)(Args_t...)const>
6770 {using type=Ret_t(Args_t...);};
6771
6772 template<typename Ret_t,typename T,typename...Args_t>
6773 struct function_type_getter_helper<Ret_t(T::*)(Args_t...)const&>
6774 {using type=Ret_t(Args_t...);};
6775
6776 template<typename Ret_t,typename T,typename...Args_t>
6777 struct function_type_getter_helper<Ret_t(T::*)(Args_t...)noexcept>
6778 {using type=Ret_t(Args_t...)noexcept;};
6779
6780 template<typename Ret_t,typename T,typename...Args_t>
6781 struct function_type_getter_helper<Ret_t(T::*)(Args_t...)&noexcept>
6782 {using type=Ret_t(Args_t...)noexcept;};
6783
6784 template<typename Ret_t,typename T,typename...Args_t>
6785 struct function_type_getter_helper<Ret_t(T::*)(Args_t...)const noexcept>
6786 {using type=Ret_t(Args_t...)noexcept;};
6787
6788 template<typename Ret_t,typename T,typename...Args_t>
6789 struct function_type_getter_helper<Ret_t(T::*)(Args_t...)const&noexcept>
6790 {using type=Ret_t(Args_t...)noexcept;};
6791
6792 template<typename T>
6793 [[nodiscard]]constexpr auto function_type_getter_conditional_helper(){
6794 if constexpr(::std::is_function_v<T>)
6795 return type_info<T>;
6796 elseif constexpr(is_pointer<T> && ::std::is_function_v<::std::remove_pointer_t<T>>)//不支持多级函数指针:懒得写(其实挺简单的),而且function_t若支持多级函数指针的推导指引会很不安全
6797 return function_type_getter_conditional_helper<::std::remove_pointer_t<T>>();
6798 else
6799 return type_info<type_name function_type_getter_helper<decltype(&T::operator())>::type>;
6800 }
6801 template<typename T>
6802 struct function_type_getter{
6803 typedef decltype(function_type_getter_conditional_helper<T>())::template_name type type;
6804 };
6805
6806 /*
6807 获取一个callable类型的“函数类型”
6808 如T(int)返回char,其函数类型便是char(int)
6809 */
6810 template<typename T>
6811 using get_function_type=function_type_getter<T>::type;
6812
6813 /*
6814 用处:容纳一个callable类型(除过函数类型,但可以是其指针)并提供operator()
6815 小包装工具,能在意想不到的地方发挥效果(比如要额外携带数据的callable类型定义!见"../../lib_loader/lib_loader.hpp")
6816 */
6817 template<class T,class Func_t=get_function_type<T>>
6818 class function_data_warpper_t;
6819 template<class T,class Ret_t,class...Args_t>
6820 struct function_data_warpper_t<T,Ret_t(Args_t...)noexcept>{
6821 static_assert(!::std::is_function_v<T>);
6822
6823 T _value;
6824
6825 function_data_warpper_t(T a)noexcept(construct<T>.nothrow<T>):_value(a){}
6826 ~function_data_warpper_t()noexcept(destruct.nothrow<T>)=default;
6827 Ret_t operator()(Args_t...args)noexcept{
6828 //BLOCK:constexpr checks
6829 if constexpr(!invoke<T>.able<Args_t...>)
6830 template_error("this T can\'t becall as args.");
6831 if constexpr(was_an_ill_form(static_cast<Ret_t>(declvalue(T)(declvalue(Args_t)...))))
6832 template_error("the return type of T was wrong.");
6833 //BLOCK_END
6834 if constexpr(type_info<Ret_t> != type_info<void>)
6835 return _value(forward<Args_t>(args)...);
6836 else
6837 _value(forward<Args_t>(args)...);
6838 }
6839 Ret_t operator()(Args_t...args)const noexcept requires(invoke<const T>.able<Args_t...>){
6840 //BLOCK:constexpr checks
6841 if constexpr(!invoke<T>.able<Args_t...>)
6842 template_error("this T can\'t becall as args.");
6843 if constexpr(was_an_ill_form(static_cast<Ret_t>(declvalue(T)(declvalue(Args_t)...))))
6844 template_error("the return type of T was wrong.");
6845 //BLOCK_END
6846 if constexpr(type_info<Ret_t> != type_info<void>)
6847 return _value(forward<Args_t>(args)...);
6848 else
6849 _value(forward<Args_t>(args)...);
6850 }
6851 [[nodiscard]]auto&get_data()noexcept{return _value;}
6852 };
6853 /*
6854 用处:容纳一个callable类型(除过函数类型,但可以是其指针)并提供operator()
6855 小包装工具,能在意想不到的地方发挥效果(比如要额外携带数据的callable类型定义!见"../../lib_loader/lib_loader.hpp")
6856 */
6857 template<class T,class Ret_t,class...Args_t>
6858 struct function_data_warpper_t<T,Ret_t(Args_t...)>{
6859 static_assert(!::std::is_function_v<T>);
6860
6861 T _value;
6862
6863 function_data_warpper_t(T a)noexcept(construct<T>.nothrow<T>):_value(a){}
6864 ~function_data_warpper_t()noexcept(destruct.nothrow<T>)=default;
6865 Ret_t operator()(Args_t...args)noexcept(invoke<T>.nothrow<Args_t...>){
6866 //BLOCK:constexpr checks
6867 if constexpr(!invoke<T>.able<Args_t...>)
6868 template_error("this T can\'t becall as args.");
6869 if constexpr(was_an_ill_form(static_cast<Ret_t>(declvalue(T)(declvalue(Args_t)...))))
6870 template_error("the return type of T was wrong.");
6871 //BLOCK_END
6872 if constexpr(type_info<Ret_t> != type_info<void>)
6873 return _value(forward<Args_t>(args)...);
6874 else
6875 _value(forward<Args_t>(args)...);
6876 }
6877 Ret_t operator()(Args_t...args)const noexcept(invoke<const T>.nothrow<Args_t...>) requires(invoke<const T>.able<Args_t...>){
6878 //BLOCK:constexpr checks
6879 if constexpr(!invoke<T>.able<Args_t...>)
6880 template_error("this T can\'t becall as args.");
6881 if constexpr(was_an_ill_form(static_cast<Ret_t>(declvalue(T)(declvalue(Args_t)...))))
6882 template_error("the return type of T was wrong.");
6883 //BLOCK_END
6884 if constexpr(type_info<Ret_t> != type_info<void>)
6885 return _value(forward<Args_t>(args)...);
6886 else
6887 _value(forward<Args_t>(args)...);
6888 }
6889 [[nodiscard]]auto&get_data()noexcept{return _value;}
6890 [[nodiscard]]const auto&get_data()const noexcept{return _value;}
6891 };
6892 #endif
6893 }
6894 using function_base_n::get_function_type;
6895 using function_base_n::function_data_warpper_t;
6896
6897 //file_end
6898
6899 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/tools/_body.hpp"
6900
6901 //file_end
6902
6903 #line 26 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/_body.hpp"
6904 }
6905
6906 namespace memory{
6907 //依赖list
6908 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/_body.hpp"
6909 //_body.hpp
6910 //at namespace elc::defs::memory
6911 /*
6912 未完成的elc解释器base文件
6913 由steve02081504与Alex0125设计、编写
6914 转载时请在不对此文件做任何修改的同时注明出处
6915 项目地址:https://github.com/steve02081504/ELC
6916 */
6917 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/alloc/_body.hpp"
6918 //_body.hpp
6919 //at namespace elc::defs::memory
6920 /*
6921 未完成的elc解释器base文件
6922 由steve02081504与Alex0125设计、编写
6923 转载时请在不对此文件做任何修改的同时注明出处
6924 项目地址:https://github.com/steve02081504/ELC
6925 */
6926 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/alloc/defs.hpp"
6927 //defs.hpp
6928 //at namespace elc::defs::memory
6929 /*
6930 未完成的elc解释器base文件
6931 由steve02081504与Alex0125设计、编写
6932 转载时请在不对此文件做任何修改的同时注明出处
6933 项目地址:https://github.com/steve02081504/ELC
6934 */
6936 namespace gc_n{
6938 void gc_for_alloc()noexcept;
6939 }
6941 namespace alloc_n{
6942 using ::elc::defs::memory::gc_n::gc_for_alloc;
6943
6944 //允许自定义对象的alloc/free/realloc/get_size_of_alloc方法:为pool留的后门(大概)
6945 //这里是缺省时的默认方法定义
6946 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/alloc/default_method/defs.hpp"
6947 //defs.hpp
6948 //at namespace elc::defs::memory::alloc_n
6949 /*
6950 未完成的elc解释器base文件
6951 由steve02081504与Alex0125设计、编写
6952 转载时请在不对此文件做任何修改的同时注明出处
6953 项目地址:https://github.com/steve02081504/ELC
6954 */
6955 namespace default_method{
6956 //BLOCK:for debug
6957 #if defined(_MSC_VER)
6958 #if defined(ELC_TEST_CHECK_MEMORY_LACK)
6959 #pragma detect_mismatch("ELC_TEST_CHECK_MEMORY_LACK","true")
6960 #else
6961 #pragma detect_mismatch("ELC_TEST_CHECK_MEMORY_LACK","false")
6962 #endif
6963 #endif
6964
6965 [[nodiscard]]inline byte*base_realloc(byte*ptr,size_t nsize,size_t align)noexcept{
6966 byte*p=::elc::APIs::alloc::realloc(ptr,nsize,align);
6967 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
6968 if(nsize==0)
6969 stest_uneventlog(ptr);
6970 if(p){
6971 ELC_TEST_EVENTNAME("base_realloc调用");
6972 if(p!=ptr)
6973 stest_uneventlog(ptr);
6974 stest_eventlog(p);
6975 }
6976 #endif
6977 return p;
6978 }
6979 [[nodiscard]]inline byte*base_aligned_alloc(size_t align,size_t size)noexcept{
6980 byte*p=::elc::APIs::alloc::aligned_alloc(align,size);
6981 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
6982 if(p){
6983 ELC_TEST_EVENTNAME("base_aligned_alloc调用");
6984 stest_eventlog(p);
6985 }
6986 #endif
6987 return p;
6988 }
6989 inline void base_free(byte*p,size_t align)noexcept{
6990 //传入需释放的数据块起始点与大小(字节)
6991 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
6992 auto tmp=stest_geteventlistfromlog(p);
6993 if(!tmp){
6994 stest_putsf(L"释放了已释放或未分配指针%p,当前的事件记录如下:",p);
6995 stest_printeventlist(stderr,stest_geteventlist());
6996 stest_wait();
6997 return;
6998 }else{
6999 stest_deleteevent(tmp);
7000 stest_uneventlog(p);
7001 }
7002 #endif
7003 ::elc::APIs::alloc::free(p,align);
7004 }
7005 inline size_t base_get_size_of_alloc(const byte*arg, size_t align)noexcept{
7006 //arg保证不与null_ptr相等
7007 const auto tmp= ::elc::APIs::alloc::get_size_of_alloc(arg,align);
7008 return tmp;
7009 }
7010 //BLOCK_END
7011
7012 template<typename T>
7013 inline void*alloc_method(type_info_t<T>)noexcept{
7014 //return空指针被允许,会引起gc_for_alloc
7015 return ::std::assume_aligned<alignof(T)>(base_aligned_alloc(alignof(T),sizeof(T)));
7016 }
7017 template<typename T>
7018 inline void*alloc_method(type_info_t<T>,size_t size)noexcept{
7019 //return空指针被允许,会引起gc_for_alloc
7020 //size被保证不为0
7021 if constexpr(type_info<T>.has_attribute(never_in_array))
7022 template_error("You cannot perform array operations on never_in_array type.");
7023 return ::std::assume_aligned<alignof(T)>(base_aligned_alloc(alignof(T),sizeof(T)*size));
7024 }
7025 template<typename T>
7026 inline size_t get_size_of_alloc_method(const T*arg)noexcept{
7027 //arg保证不与null_ptr相等
7028 return base_get_size_of_alloc(cast_to_data(arg),alignof(T))/sizeof(T);
7029 }
7030 template<typename T>
7031 inline void free_method(T*arg)noexcept{
7032 base_free(cast_to_data(arg),alignof(T));
7033 }
7034 template<typename T>
7035 inline void*realloc_method(T*&ptr,size_t new_size)noexcept{
7036 //return空指针被允许,会引起gc_for_alloc,但ptr值必须保持有效以保证gc_for_alloc后再次realloc有效
7037 //new_size被保证不为0
7038 //align维持不变
7039 //但只允许在扩大数据块时可选的移动数据块
7040 if constexpr(type_info<T>.has_attribute(never_in_array))
7041 template_error("You cannot perform array operations on never_in_array type.");
7042 return ptr=reinterpret_cast<T*>(base_realloc(cast_to_data(ptr),sizeof(T)*new_size,alignof(T)));
7043 }
7044 }
7045
7046 //file_end
7047
7048 #line 20 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/alloc/defs.hpp"
7049
7050 enable_adl(the_alloc_method);
7051 template<typename T>
7052 inline void*alloc_method(type_info_t<T>)noexcept{
7053 //return空指针被允许,会引起gc_for_alloc
7054 if constexpr(was_not_an_ill_form(the_alloc_method(type_info<T>)))
7055 return the_alloc_method(type_info<T>);
7056 else
7057 return default_method::alloc_method(type_info<T>);
7058 }
7059 template<typename T>
7060 inline void*alloc_method(type_info_t<T>,size_t size)noexcept{
7061 //return空指针被允许,会引起gc_for_alloc
7062 //size被保证不为0
7063 if constexpr(was_not_an_ill_form(the_alloc_method(type_info<T>,size)))
7064 return the_alloc_method(type_info<T>,size);
7065 else
7066 return default_method::alloc_method(type_info<T>,size);
7067 }
7068 enable_adl(the_get_size_of_alloc_method);
7069 template<typename T>
7070 inline size_t get_size_of_alloc_method(const T*arg)noexcept{
7071 //arg保证不与null_ptr相等
7073 return the_get_size_of_alloc_method(arg);
7074 else
7075 return default_method::get_size_of_alloc_method(arg);
7076 }
7077 enable_adl(the_free_method);
7078 template<typename T>
7079 inline void free_method(T*arg)noexcept{
7080 if constexpr(was_not_an_ill_form(the_free_method(arg)))
7081 the_free_method(arg);
7082 else
7083 default_method::free_method(arg);
7084 }
7085 enable_adl(the_realloc_method);
7086 template<typename T>
7087 inline void*realloc_method(T*&ptr,size_t new_size)noexcept{
7088 //return空指针被允许,会引起gc_for_alloc,但ptr值必须保持有效以保证gc_for_alloc后再次realloc有效
7089 //new_size被保证不为0
7090 //align维持不变
7091 //但只允许在扩大数据块时可选的移动数据块
7092 if constexpr(was_not_an_ill_form(the_realloc_method(ptr,new_size)))
7093 return the_realloc_method(ptr,new_size);
7094 else
7095 return default_method::realloc_method(ptr,new_size);
7096 }
7097
7101
7104 template<class T>
7107 [[nodiscard]]static T*base_call()noexcept{
7108 void*tmp;
7109 while(!assign(tmp,alloc_method(type_info<T>)))gc_for_alloc();
7110 return reinterpret_cast<T*>(tmp);
7111 }
7112 [[nodiscard]]static T*base_call(size_t size)noexcept{
7114 if constexpr(type_info<T>.has_attribute(never_in_array))
7115 template_error("You can\'t alloc an array for never_in_array type.");
7116 if(size){//null_ptr不一定等价于nullptr,请勿删除本行
7117 void*tmp;
7118 while(!assign(tmp,alloc_method(type_info<T>,size)))gc_for_alloc();
7119 return reinterpret_cast<T*>(tmp);
7120 }else return null_ptr;
7121 }
7122 [[nodiscard]]/*static*/force_inline T*operator()()const noexcept{return base_call();}
7123 [[nodiscard]]/*static*/force_inline T*operator()(size_t size)const noexcept{return base_call(size);}
7125 size_t _size;
7126 [[nodiscard]]force_inline T*operator()()const noexcept{return base_call(_size);}
7127 };
7128 [[nodiscard]]force_inline constexpr alloc_array_t operator[](size_t a)const noexcept{return{a};}
7129 };
7133 template<class T>
7134 constexpr alloc_t<T>alloc{};
7135
7138 constexpr struct free_t{
7140 template<class T>
7141 static void base_call(T*p)noexcept{
7143 if(p!=null_ptr)//null_ptr不一定等价于nullptr,请勿删除本行
7144 free_method(p);
7145 }
7146 template<class T>
7147 /*static*/force_inline void operator()(T*p)const noexcept{base_call(p);}
7148 }free{};
7149
7152 constexpr struct realloc_t{
7154 template<class T>
7155 static void base_call(T*&ptr,size_t nsize)noexcept{
7157 if constexpr(type_info<T>.has_attribute(never_in_array))
7158 template_error("You cannot perform array operations on never_in_array type.");
7159 //template_warning("For never_in_array type,realloc will free ptr when new_size=0 else do nothing.");
7160 if(nsize){//null_ptr不一定等价于nullptr,请勿删除本行
7161 if constexpr(type_info<T>.not_has_attribute(never_in_array))
7162 if(ptr!=null_ptr){//null_ptr不一定等价于nullptr,请勿删除本行
7163 while(!realloc_method(ptr,nsize))gc_for_alloc();
7164 }else
7165 ptr=alloc<T>(nsize);
7166 }else{
7167 free(ptr);
7168 ptr=null_ptr;
7169 }
7170 }
7171 template<class T>
7172 /*static*/force_inline void operator()(T*&ptr,size_t nsize)const noexcept{
7173 base_call(ptr,nsize);
7174 }
7176 size_t _size;
7177 template<class T>
7178 [[nodiscard]]force_inline T*operator()(T*&ptr)const noexcept{return base_call(ptr,_size);}
7179 };
7180 [[nodiscard]]force_inline constexpr realloc_array_t operator[](size_t a)const noexcept{return{a};}
7181 }realloc{};
7182
7186 constexpr struct get_size_of_alloc_t{
7187 template<typename T>
7188 static constexpr bool able=true;
7189 template<typename T>
7190 static constexpr bool nothrow=noexcept(get_size_of_alloc_method(declvalue(const T*)));
7191
7192 template<typename T> requires able<T>
7193 static size_t base_call(const T*arg)noexcept(nothrow<T>){
7195 if(arg==null_ptr)
7196 return 0;
7197 return get_size_of_alloc_method(arg);
7198 }
7199
7200 template<typename T> requires able<T>
7201 force_inline size_t operator()(const T*arg)const noexcept(nothrow<T>){
7202 return base_call(arg);
7203 }
7204 }get_size_of_alloc{};
7205
7208 constexpr struct copy_alloc_t{
7209 template<typename T>
7210 static constexpr bool able=true;
7211 template<typename T>
7212 static constexpr bool nothrow=get_size_of_alloc.nothrow<T>;
7213
7214 template<typename T> requires able<T>
7215 static T*base_call(const T*arg)noexcept(nothrow<T>){
7217 return alloc<T>(get_size_of_alloc(arg));
7218 }
7219
7220 template<typename T> requires able<T>
7221 force_inline T*operator()(const T*arg)const noexcept(nothrow<T>){
7222 return base_call(arg);
7223 }
7224 }copy_alloc{};
7225 }
7226
7227 //file_end
7228
7229 #line 9 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/alloc/_body.hpp"
7230 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/alloc/_export.hpp"
7231 //_export.hpp
7232 //at namespace elc::defs::memory
7233 /*
7234 未完成的elc解释器base文件
7235 由steve02081504与Alex0125设计、编写
7236 转载时请在不对此文件做任何修改的同时注明出处
7237 项目地址:https://github.com/steve02081504/ELC
7238 */
7239 #define export using alloc_n::
7240 export alloc;
7241 export free;
7242 export realloc;
7243 export get_size_of_alloc;
7244 export copy_alloc;
7245 #undef export
7246
7247 //file_end
7248
7249 #line 10 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/alloc/_body.hpp"
7250 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
7251 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/alloc/_test.hpp"
7252 //_test.hpp
7253 //at namespace elc::defs::memory
7254 /*
7255 未完成的elc解释器base文件
7256 由steve02081504与Alex0125设计、编写
7257 转载时请在不对此文件做任何修改的同时注明出处
7258 项目地址:https://github.com/steve02081504/ELC
7259 */
7260 inline void check_memory_lack()noexcept{
7261 stest_mapeventlogwith(lambda(const void*p,steventlist*a)noexcept{
7262 stest_putsf(L"内存泄露于%p,分配自:",p);
7263 stest_printeventlist(stdout,stest_copyeventlist(a));
7264 //alloc_n::base_free(remove_const(p));
7265 //stest_puts(L"已释放");
7266 stest_wait();
7267 });
7268 }
7269 #if defined(ELC_TEST_ON)
7270 namespace alloc_n{
7271 //BLOCK:for debug
7272 inline void test(){
7273 ELC_TEST_EVENTNAME("alloc部分测试");
7274 using ::std::time;
7275 using ::std::rand;
7276 using ::std::srand;
7277 srand((unsigned int)time(nullptr));
7278 for(int i=rand()%100+40;i--;){
7279 int*p=alloc<int>(50);
7280 p[0]=72;
7281 stest_accert(get_size_of_alloc(p)==50);
7282 p[49]=rand();
7283 p[19]=666;
7284 realloc(p,20);
7285 stest_accert(get_size_of_alloc(p)==20);
7286 stest_accert(p[19]==666);
7287 stest_accert(p[0]==72);
7288 free(p);
7289 }
7290 check_memory_lack();
7291 }
7292 inline void test_log_out(){
7293 }
7294 inline void test_end(){
7295 }
7296 //BLOCK_END
7297 }
7298 #endif
7299
7300 //file_end
7301
7302 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/alloc/_body.hpp"
7303 #endif
7304
7305 //file_end
7306
7307 #line 9 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/_body.hpp"
7308 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/get/_body.hpp"
7309 //_body.hpp
7310 //at namespace elc::defs::memory
7311 /*
7312 未完成的elc解释器base文件
7313 由steve02081504与Alex0125设计、编写
7314 转载时请在不对此文件做任何修改的同时注明出处
7315 项目地址:https://github.com/steve02081504/ELC
7316 */
7317 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/get/defs.hpp"
7318 //defs.hpp
7319 //at namespace elc::defs::memory
7320 /*
7321 未完成的elc解释器base文件
7322 由steve02081504与Alex0125设计、编写
7323 转载时请在不对此文件做任何修改的同时注明出处
7324 项目地址:https://github.com/steve02081504/ELC
7325 */
7326 namespace abstract_base_n{
7327 /*
7328 ELC的虚基类模块,适用于unget
7329 处理虚基类到实例类的偏移与模板实例化差异
7330 原理:
7331 虚函数间接调用以从base_t&转为T&
7332 运行时计算偏移以从T*转换base_t*
7333 用法:is_common_attribute␁
7334 */
7336 }
7337 namespace get_n{
7339 //struct build_by_get_only{};已定义于 "../../base_defs/special_attribute.hpp"
7340
7341 /*向后减小数据块大小并转移原有实例的生命周期,但并不析构旧的实例*/
7342 template<typename T>
7343 void alloc_size_cut(T*&arg,size_t to_size)noexcept{
7344 realloc(arg,to_size);
7345 }
7346 /*向后扩大数据块大小并转移原有实例的生命周期,但并不构造新的实例*/
7347 template<typename T>
7348 void alloc_size_grow(T*&arg,size_t to_size)noexcept(move.trivial<T> or move.nothrow<T>){
7349 if constexpr(move.trivial<T>)
7350 realloc(arg,to_size);
7351 else{
7352 T*tmp=alloc<T>(to_size);
7353 auto from_size=get_size_of_alloc(arg);
7354 if constexpr(!move.nothrow<T>){
7355 template_warning("the move of T was not noexcept,this may cause memory lack.");
7356 try{
7357 move[from_size](note::from(arg),note::to(tmp));
7358 }catch(...){
7359 free(tmp);
7360 throw;
7361 }
7362 }else{
7363 move[from_size](note::from(arg),note::to(tmp));
7364 }
7365 free(arg);
7366 arg=tmp;
7367 }
7368 }
7369 /*在指定位置插入未初始化数据块并转移原有实例的生命周期,但并不构造新的实例*/
7370 template<typename T>
7371 void alloc_size_grow_with_insert_uninitialized_data(T*&arg,size_t insert_pos,size_t insert_size)noexcept(move.trivial<T> or move.nothrow<T>){
7372 const auto from_size=get_size_of_alloc(arg);
7373 const auto to_size=from_size+insert_size;
7374 const auto size_before_insert=insert_pos;
7375 const auto size_after_insert=from_size-insert_pos;
7376 if constexpr(move.trivial<T>){
7377 realloc(arg,to_size);
7378 memmove(arg+size_before_insert+insert_size,arg+size_before_insert,size_after_insert*sizeof(T));
7379 }
7380 else{
7381 T*tmp=alloc<T>(to_size);
7382 if constexpr(!move.nothrow<T>){
7383 template_warning("the move of T was not noexcept,this may cause memory lack.");
7384 try{
7385 move[size_before_insert](note::from(arg),note::to(tmp));
7386 move[size_after_insert](note::from(arg+insert_pos),note::to(tmp+insert_pos+insert_size));
7387 }catch(...){
7388 free(tmp);
7389 throw;
7390 }
7391 }else{
7392 move[size_before_insert](note::from(arg),note::to(tmp));
7393 move[size_after_insert](note::from(arg+insert_pos),note::to(tmp+insert_pos+insert_size));
7394 }
7395 free(arg);
7396 arg=tmp;
7397 }
7398 }
7399 /*
7400 在指定位置插入未初始化数据块并转移原有实例的生命周期,但并不构造新的实例
7401 若有多余的大小,追加到末尾
7402 返回多余的大小
7403 */
7404 template<typename T>
7405 size_t alloc_size_grow_with_insert_uninitialized_data(T*&arg,size_t to_size,size_t insert_pos,size_t insert_size)noexcept(move.trivial<T> or move.nothrow<T>){
7406 const auto from_size=get_size_of_alloc(arg);
7407 const auto size_before_insert=insert_pos;
7408 const auto size_after_insert=from_size-insert_pos;
7409 if constexpr(move.trivial<T>){
7410 realloc(arg,to_size);
7411 memmove(arg+size_before_insert+insert_size,arg+size_before_insert,size_after_insert*sizeof(T));
7412 }
7413 else{
7414 T*tmp=alloc<T>(to_size);
7415 if constexpr(!move.nothrow<T>){
7416 template_warning("the move of T was not noexcept,this may cause memory lack.");
7417 try{
7418 move[size_before_insert](note::from(arg),note::to(tmp));
7419 move[size_after_insert](note::from(arg+insert_pos),note::to(tmp+insert_pos+insert_size));
7420 }catch(...){
7421 free(tmp);
7422 throw;
7423 }
7424 }else{
7425 move[size_before_insert](note::from(arg),note::to(tmp));
7426 move[size_after_insert](note::from(arg+insert_pos),note::to(tmp+insert_pos+insert_size));
7427 }
7428 free(arg);
7429 arg=tmp;
7430 }
7431 return to_size-from_size-insert_size;
7432 }
7433 /*向前减小数据块大小并转移原有实例的生命周期,但并不析构旧的实例*/
7434 template<typename T>
7435 void forward_alloc_size_cut(T*&arg,size_t to_size)noexcept(move.trivial<T> or move.nothrow<T>){
7436 const auto from_size=get_size_of_alloc(arg);
7437 const auto cut_size=from_size-to_size;
7438 if constexpr(move.trivial<T>){
7439 ::std::memmove(arg,add_const(arg+cut_size),to_size*sizeof(T));
7440 realloc(arg,to_size);
7441 }
7442 else{
7443 T*tmp=alloc<T>(to_size);
7444 if constexpr(!move.nothrow<T>){
7445 template_warning("the move of T was not noexcept,this may cause memory lack.");
7446 try{
7447 move[to_size](note::from(arg+cut_size),note::to(tmp));
7448 }catch(...){
7449 free(tmp);
7450 throw;
7451 }
7452 }else{
7453 move[to_size](note::from(arg+cut_size),note::to(tmp));
7454 }
7455 free(arg);
7456 arg=tmp;
7457 }
7458 }
7459 /*向前扩大数据块大小并转移原有实例的生命周期,但并不构造新的实例*/
7460 template<typename T>
7461 void forward_alloc_size_grow(T*&arg,size_t to_size)noexcept(move.trivial<T> or move.nothrow<T>){
7462 const auto from_size=get_size_of_alloc(arg);
7463 const auto grow_size=to_size-from_size;
7464 if constexpr(move.trivial<T>){
7465 realloc(arg,to_size);
7466 ::std::memmove(arg+grow_size,add_const(arg),from_size*sizeof(T));
7467 }
7468 else{
7469 T*tmp=alloc<T>(to_size);
7470 if constexpr(!move.nothrow<T>){
7471 template_warning("the move of T was not noexcept,this may cause memory lack.");
7472 try{
7473 move[from_size](note::from(arg),note::to(tmp+grow_size));
7474 }catch(...){
7475 free(tmp);
7476 throw;
7477 }
7478 }else{
7479 move[from_size](note::from(arg),note::to(tmp+grow_size));
7480 }
7481 free(arg);
7482 arg=tmp;
7483 }
7484 }
7485 /*
7486 在指定位置插入未初始化数据块并转移原有实例的生命周期,但并不构造新的实例
7487 若有多余的大小,追加到前端
7488 返回多余的大小
7489 */
7490 template<typename T>
7491 size_t forward_alloc_size_grow_with_insert_uninitialized_data(T*&arg,size_t to_size,size_t insert_pos,size_t insert_size)noexcept(move.trivial<T> or move.nothrow<T>){
7492 const auto from_size=get_size_of_alloc(arg);
7493 const auto grow_size=to_size-from_size;
7494 const auto before_grow_size=grow_size-insert_size;
7495 const auto size_before_insert=insert_pos;
7496 const auto size_after_insert=from_size-insert_pos;
7497 if constexpr(move.trivial<T>){
7498 realloc(arg,to_size);
7499 const auto orogin_data_ptr=arg+before_grow_size;
7500 ::std::memmove(orogin_data_ptr+size_before_insert+insert_size,arg+size_before_insert,size_after_insert*sizeof(T));
7501 ::std::memmove(orogin_data_ptr,arg,size_before_insert*sizeof(T));
7502 }
7503 else{
7504 T*tmp=alloc<T>(to_size);
7505 if constexpr(!move.nothrow<T>){
7506 template_warning("the move of T was not noexcept,this may cause memory lack.");
7507 try{
7508 const auto orogin_data_ptr=tmp+before_grow_size;
7509 move[size_before_insert](note::from(arg),note::to(orogin_data_ptr));
7510 move[size_after_insert](note::from(arg+size_before_insert),note::to(orogin_data_ptr+size_before_insert+insert_size));
7511 }catch(...){
7512 free(tmp);
7513 throw;
7514 }
7515 }else{
7516 const auto orogin_data_ptr=tmp+before_grow_size;
7517 move[size_before_insert](note::from(arg),note::to(orogin_data_ptr));
7518 move[size_after_insert](note::from(arg+size_before_insert),note::to(orogin_data_ptr+size_before_insert+insert_size));
7519 }
7520 free(arg);
7521 arg=tmp;
7522 }
7523 return before_grow_size;
7524 }
7525
7526 struct base_get_t{};
7527 template<typename T>
7530 template<class...Args>
7531 static constexpr bool able=construct<T>.able<Args...>&&destruct.able<T>;
7532 template<class...Args>
7533 static constexpr bool nothrow=construct<T>.nothrow<Args...>;
7534
7535 template<class...Args> requires able<Args...>
7536 [[nodiscard]]T* operator()(Args&&...rest)const noexcept(nothrow<Args...>){
7538 return construct<T>[alloc<T>()](forward<Args>(rest)...);
7539 }
7540
7542 size_t _size;
7543 template<class...Args> requires able<Args...>
7544 [[nodiscard]]T* operator()(Args&&...rest)const noexcept(nothrow<Args...>){
7546 if constexpr(type_info<T>.has_attribute(never_in_array))
7547 template_error("You can\'t get an array for never_in_array type.");
7548 return construct<T>[alloc<T>(_size)][_size](forward<Args>(rest)...);
7549 }
7550 };
7551 [[nodiscard]]constexpr array_get_t operator[](size_t size)const noexcept{return{size};}
7552
7553 static constexpr struct as_array_t{
7554 template<typename U>
7555 static constexpr bool able=copy_construct.able<T>&&destruct.able<T>&&is_array_like_for<T,U>;
7556 template<typename U>
7557 static constexpr bool nothrow=copy_construct.nothrow<T>;
7558
7559 [[nodiscard]]T* operator()(array_like_view_t<const T>a)const noexcept(nothrow<void>){
7561 if constexpr(type_info<T>.has_attribute(never_in_array))
7562 template_error("You can\'t get an array for never_in_array type.");
7563 auto size=a.size();
7564 auto aret=alloc<T>[size]();
7565 copy_construct[size](note::from(a.begin()),note::to(aret));
7566 return aret;
7567 }
7568 }as_array{};
7569
7570 static constexpr struct apply_end_t{
7571 template<typename U>
7572 static constexpr bool able=copy_construct.able<T>&&move.able<T>&&is_array_like_for<T,U>;
7573 template<typename U>
7574 static constexpr bool nothrow=copy_construct.nothrow<T>&&move.nothrow<T>;
7575
7576 T* operator()(note::to_t<T*&> to,array_like_view_t<const T>a)const noexcept(nothrow<void>){
7578 auto&ptr=to.value;
7579 auto from_size=get_size_of_alloc(ptr);
7580 auto a_size=a.size();
7581 alloc_size_grow(ptr,from_size+a_size);
7582 copy_construct[a_size](note::from(a.begin()),note::to(ptr+from_size));
7583 return ptr;
7584 }
7585 T* operator()(note::to_t<T*&> to,const T&a)const noexcept(nothrow<void>){
7587 auto&ptr=to.value;
7588 auto from_size=get_size_of_alloc(ptr);
7589 alloc_size_grow(ptr,from_size+1);
7590 copy_construct(note::from(&a),note::to(ptr+from_size));
7591 return ptr;
7592 }
7593 T* operator()(note::to_t<T*&> to,T&&a)const noexcept(nothrow<void>){
7595 auto&ptr=to.value;
7596 auto from_size=get_size_of_alloc(ptr);
7597 alloc_size_grow(ptr,from_size+1);
7598 move_construct(note::from(&a),note::to(ptr+from_size));
7599 return ptr;
7600 }
7601 }apply_end{};
7602
7603 static constexpr struct remove_t{
7604 template<typename U>
7605 static constexpr bool able=destruct.able<T>&&move.able<T>&&is_array_like_for<T,U>;
7606 template<typename U>
7607 static constexpr bool nothrow=destruct.nothrow<T>&&move.nothrow<T>;
7608
7609 bool operator()(array_like_view_t<const T>a,note::from_t<T*>from)const noexcept(nothrow<void>){
7611 auto ptr=from.value;
7612 auto from_size=get_size_of_alloc(ptr);
7613 T*ptr_to_a=in_range(a,{ptr,note::size(from_size)});
7614 auto a_size=a.size();
7615 if(!ptr_to_a)
7616 return false;
7617
7618 destruct[a_size](ptr_to_a);
7619 move[(ptr+from_size)-(ptr_to_a+a_size)](note::from(ptr_to_a+a_size),note::to(ptr_to_a));
7620 alloc_size_cut(ptr,from_size-a_size);
7621 return true;
7622 }
7623 }remove{};
7624 };
7625 template<typename T>
7626 constexpr get_t<T>get{};
7627
7628
7629 constexpr struct unget_t{
7630 template<typename T>
7631 static constexpr bool able=destruct.able<T>;
7632 template<typename T>
7633 static constexpr bool nothrow=destruct.nothrow<T>;
7634
7635 template<typename T> requires able<T>
7636 void operator()(T*a)const noexcept(nothrow<T>){
7638 if(a!=null_ptr){
7639 if constexpr(type_info<T>.has_attribute(abstract_base))
7640 #if defined(_MSC_VER)
7641 [[gsl::suppress(f.6)]]
7642 #endif
7643 attribute_ptr_cast<abstract_base>(a)->abstract_method_unget_this();
7644 else{
7645 if constexpr(!destruct.nothrow<T>)
7646 template_warning("the destructer of T was not noexcept,this may cause memory lack.");
7647 if constexpr(type_info<T>.has_attribute(never_in_array))
7648 destruct(a);
7649 else
7650 destruct[get_size_of_alloc(a)](a);
7651 free(a);
7652 }
7653 }
7654 }
7655 /*适用于unget(this,not destruct);*/
7656 template<typename T> requires able<T>
7657 void operator()(T*a,decltype(destruct)::not_t)const noexcept(nothrow<T>){
7659 free(a);
7660 }
7661 }unget{};
7662
7663 constexpr struct get_resize_t{
7664 template<typename T>
7665 static constexpr bool able=construct<T>.able<>&&destruct.able<T>&&move.able<T>;
7666 template<typename T>
7667 static constexpr bool nothrow=type_info<T>.not_has_attribute(abstract_base)&&construct<T>.nothrow<>&&destruct.nothrow<T>&&move.nothrow<T>;
7668
7669 template<typename T> requires able<T>
7670 static void base_call(T*&arg,const size_t to_size)noexcept(nothrow<T>){
7671 if constexpr(type_info<T>.has_attribute(never_in_array)){
7672 template_warning("For never_in_array type,get_resize will unget ptr when new_size=0 else do nothing.");
7673 if(to_size)
7674 return;
7675 unget(arg);
7676 arg=null_ptr;
7677 }elseif constexpr(type_info<T>.has_attribute(abstract_base)){
7678 arg=attribute_ptr_cast<abstract_base>(arg)->abstract_method_get_resize_this(to_size);
7679 }else{
7680 const size_t from_size=get_size_of_alloc(arg);
7681 if(from_size==to_size)
7682 return;
7683 elseif(from_size > to_size){
7684 destruct[from_size-to_size](arg+to_size);
7685 alloc_size_cut(arg,to_size);
7686 }elseif(from_size){
7687 alloc_size_grow(arg,to_size);
7688 construct<T>[arg+from_size][to_size-from_size]();
7689 }else
7690 arg=get<T>[to_size]();
7691 }
7692 }
7693
7694 template<typename T> requires able<T>
7695 inline void operator()(T*&arg,size_t to_size)const noexcept(nothrow<T>){
7697 base_call(arg,to_size);
7698 }
7699 template<typename T> requires able<T>
7700 [[nodiscard]]inline T* operator()(T*&&arg,size_t to_size)const noexcept(nothrow<T>){
7702 base_call(arg,to_size);
7703 return arg;
7704 }
7705
7706 static constexpr struct insert_t{
7707 template<typename T>
7708 static constexpr bool able=get_resize_t::able<T>;
7709 template<typename T>
7710 static constexpr bool nothrow=get_resize_t::nothrow<T>;
7711 template<typename T> requires(able<T> && construct<T>.able<>)
7712 void operator()(T*&arg,size_t insert_pos,size_t insert_size)const noexcept(nothrow<T>){
7713 if(insert_size){
7715 alloc_size_grow_with_insert_uninitialized_data(arg,insert_pos,insert_size);
7716 construct<T>[arg+insert_pos][insert_size]();
7717 }
7718 }
7719 template<typename T> requires(able<T> && copy_construct.able<T>)
7720 void operator()(T*&arg,size_t insert_pos,size_t insert_size,const T*insert_data)const noexcept(nothrow<T>){
7721 if(insert_size){
7723 alloc_size_grow_with_insert_uninitialized_data(arg,insert_pos,insert_size);
7724 copy_construct[insert_size](note::from(insert_data),note::to(arg+insert_pos));
7725 }
7726 }
7727 }insert{};
7728 static constexpr struct insert_resize_t{
7729 template<typename T>
7730 static constexpr bool able=get_resize_t::able<T>;
7731 template<typename T>
7732 static constexpr bool nothrow=get_resize_t::nothrow<T>;
7733 template<typename T> requires(able<T> && construct<T>.able<> && copy_construct.able<T>)
7734 void operator()(T*&arg,size_t insert_pos,size_t insert_size,const T*insert_data,size_t to_size)const noexcept(nothrow<T>){
7736 auto end_grow_size=alloc_size_grow_with_insert_uninitialized_data(arg,to_size,insert_pos,insert_size);
7737 copy_construct[insert_size](note::from(insert_data),note::to(arg+insert_pos));
7738 construct<T>[arg+to_size-end_grow_size][end_grow_size]();
7739 }
7740 }insert_with_resize{};
7741 }get_resize{};
7742
7743 constexpr struct get_forward_resize_t{
7744 template<typename T>
7745 static constexpr bool able=construct<T>.able<>&&destruct.able<T>&&move.able<T>;
7746 template<typename T>
7747 static constexpr bool nothrow=type_info<T>.not_has_attribute(abstract_base)&&construct<T>.nothrow<>&&destruct.nothrow<T>&&move.nothrow<T>;
7748
7749 template<typename T> requires able<T>
7750 static void base_call(T*&arg,const size_t to_size)noexcept(nothrow<T>){
7752 if constexpr(type_info<T>.has_attribute(never_in_array)){
7753 template_warning("For never_in_array type,get_forward_resize will unget ptr when new_size=0 else do nothing.");
7754 if(to_size)
7755 return;
7756 unget(arg);
7757 arg=null_ptr;
7758 }elseif constexpr(type_info<T>.has_attribute(abstract_base)){
7759 arg=attribute_ptr_cast<abstract_base>(arg)->abstract_method_get_forward_resize_this(to_size);
7760 }else{
7761 const size_t from_size=get_size_of_alloc(arg);
7762 if(from_size==to_size)
7763 return;
7764 elseif(from_size > to_size){
7765 destruct[from_size-to_size](arg);
7766 forward_alloc_size_cut(arg,to_size);
7767 }elseif(from_size){
7768 forward_alloc_size_grow(arg,to_size);
7769 construct<T>[arg][to_size-from_size]();
7770 }else
7771 arg=get<T>[to_size]();
7772 }
7773 }
7774
7775 template<typename T> requires able<T>
7776 inline void operator()(T*&arg,size_t to_size)const noexcept(nothrow<T>){
7777 base_call(arg,to_size);
7778 }
7779 template<typename T> requires able<T>
7780 [[nodiscard]]inline T* operator()(T*&&arg,size_t to_size)const noexcept(nothrow<T>){
7781 base_call(arg,to_size);
7782 return arg;
7783 }
7784
7785 static constexpr struct insert_t{
7786 template<typename T>
7787 static constexpr bool able=get_resize_t::able<T>;
7788 template<typename T>
7789 static constexpr bool nothrow=get_resize_t::nothrow<T>;
7790 template<typename T> requires(able<T> && construct<T>.able<>)
7791 void operator()(T*&arg,size_t insert_pos,size_t insert_size)const noexcept(nothrow<T>){
7793 get_resize.insert(arg,insert_pos,insert_size);
7794 }
7795 template<typename T> requires(able<T> && copy_construct.able<T>)
7796 void operator()(T*&arg,size_t insert_pos,size_t insert_size,const T*insert_data)const noexcept(nothrow<T>){
7798 get_resize.insert(arg,insert_pos,insert_size,insert_data);
7799 }
7800 }insert{};
7801 static constexpr struct insert_resize_t{
7802 template<typename T>
7803 static constexpr bool able=get_resize_t::able<T>;
7804 template<typename T>
7805 static constexpr bool nothrow=get_resize_t::nothrow<T>;
7806 template<typename T> requires(able<T> && construct<T>.able<> && copy_construct.able<T>)
7807 void operator()(T*&arg,size_t insert_pos,size_t insert_size,const T*insert_data,size_t to_size)const noexcept(nothrow<T>){
7808 if(insert_size){
7810 auto before_grow_size=forward_alloc_size_grow_with_insert_uninitialized_data(arg,to_size,insert_pos,insert_size);
7811 const auto orogin_arg=arg+before_grow_size;
7812 copy_construct[insert_size](note::from(insert_data),note::to(orogin_arg+insert_pos));
7813 construct<T>[arg][before_grow_size]();
7814 }
7815 }
7816 }insert_with_resize{};
7817 }get_forward_resize{};
7818
7819 constexpr struct get_size_of_get_t{
7820 template<typename T>
7821 static constexpr bool able=true;
7822 template<typename T>
7823 static constexpr bool nothrow=noexcept(get_size_of_alloc(declvalue(const T*)));
7824
7825 template<typename T> requires able<T>
7826 static size_t base_call(const T*arg)noexcept(nothrow<T>){
7828 return get_size_of_alloc(arg);
7829 }
7830
7831 template<typename T> requires able<T>
7832 size_t operator()(const T*arg)const noexcept(nothrow<T>){
7833 return base_call(arg);
7834 }
7835 }get_size_of_get{};
7836
7837 constexpr struct copy_get_t{
7838 template<typename T>
7839 static constexpr bool able=copy_construct.able<T> || type_info<T>.has_attribute(abstract_base);
7840 template<typename T>
7841 static constexpr bool nothrow=copy_construct.nothrow<T>;
7842
7843 template<typename T> requires able<T>
7844 static T*base_call(const T*arg)noexcept(nothrow<T>){
7846 if constexpr(type_info<T>.has_attribute(abstract_base))
7847 return remove_const(attribute_ptr_cast<abstract_base>(arg))->abstract_method_copy_get_this();
7848 else
7849 return copy_construct(note::from(arg),note::to(copy_alloc(arg)),get_size_of_get(arg));
7850 }
7851
7852 template<typename T> requires able<T>
7853 T*operator()(const T*arg)const noexcept(nothrow<T>){
7854 return base_call(arg);
7855 }
7856 }copy_get{};
7857 }
7858
7859 //file_end
7860
7861 #line 9 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/get/_body.hpp"
7862 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/get/_export.hpp"
7863 //_export.hpp
7864 //at namespace elc::defs::memory
7865 /*
7866 未完成的elc解释器base文件
7867 由steve02081504与Alex0125设计、编写
7868 转载时请在不对此文件做任何修改的同时注明出处
7869 项目地址:https://github.com/steve02081504/ELC
7870 */
7871 #define export using get_n::
7872 export get;
7873 export get_resize;
7874 export get_forward_resize;
7875 export unget;
7876 export get_size_of_get;
7877 export copy_get;
7878 //export build_by_get_only;
7879 #undef export
7880
7881 //file_end
7882
7883 #line 10 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/get/_body.hpp"
7884 #if defined(ELC_TEST_ON)
7885 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/get/_test.hpp"
7886 //_test.hpp
7887 //at namespace elc::defs::memory
7888 /*
7889 未完成的elc解释器base文件
7890 由steve02081504与Alex0125设计、编写
7891 转载时请在不对此文件做任何修改的同时注明出处
7892 项目地址:https://github.com/steve02081504/ELC
7893 */
7894 namespace get_n{
7895 //BLOCK:for debug
7896 inline void test(){
7897 ELC_TEST_EVENTNAME("get部分测试");
7898 {
7899 ste::tester::setzero();
7900 tester*p=get<tester>[50]();
7901 stest_accert(tester::getbuildtime()==50);
7902 get_resize(p,60);
7903 //destroytime:50(+50) cause move(move_construct&destruct).
7904 stest_accert(tester::getdestroytime()==50);
7905 stest_accert(tester::getbuildtime()==60);
7906 int i=0;
7907 do
7908 p[i]();//写入测试
7909 while(++i!=60);
7910 stest_accert(tester::getcalltime()==60);
7911 unget(p);
7912 //destroytime:110(+60) cause destruct.
7913 stest_accert(tester::getdestroytime()==110);
7914 }
7915 check_memory_lack();
7916 }
7917 inline void test_log_out(){
7918 }
7919 inline void test_end(){
7920 }
7921 //BLOCK_END
7922 }
7923
7924 //file_end
7925
7926 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/get/_body.hpp"
7927 #endif
7928
7929 //file_end
7930
7931 #line 10 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/_body.hpp"
7932 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/abstract_base/_body.hpp"
7933 //_body.hpp
7934 //at namespace elc::defs::memory
7935 /*
7936 未完成的elc解释器base文件
7937 由steve02081504与Alex0125设计、编写
7938 转载时请在不对此文件做任何修改的同时注明出处
7939 项目地址:https://github.com/steve02081504/ELC
7940 */
7941 //UF
7942 namespace abstract_base_n{
7943 /*
7944 ELC的虚基类模块,适用于unget
7945 处理虚基类到实例类的偏移与模板实例化差异
7946 原理:
7947 虚函数间接调用以从base_t&转为T&
7948 运行时计算偏移以从T*转换base_t*
7949 用法:is_common_attribute␁
7950 */
7951 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/abstract_base/pointer_off_set.hpp"
7952 //pointer_off_set.hpp
7953 //at namespace elc::defs::memory::abstract_base_n
7954 /*
7955 未完成的elc解释器base文件
7956 由steve02081504与Alex0125设计、编写
7957 转载时请在不对此文件做任何修改的同时注明出处
7958 项目地址:https://github.com/steve02081504/ELC
7959 */
7960 inline thread_local pointer base_ptr;
7961 inline thread_local ptrdiff_t off_set;
7962 distinctive inline void is_base_ptr(void*a)noexcept{base_ptr=a;}
7963 distinctive inline void is_instance_ptr(void*a)noexcept{off_set=get_off_set(note::from(a),note::to(base_ptr));}
7964 distinctive inline void*get_ptr_after_off_set(void*a)noexcept{return apply_off_set(a,off_set);}
7965
7966 //file_end
7967
7968 #line 19 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/abstract_base/_body.hpp"
7969 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/abstract_base/abstract_base_vtable.hpp"
7970 //abstract_base_vtable.hpp
7971 //at namespace elc::defs::memory::abstract_base_n
7972 /*
7973 未完成的elc解释器base文件
7974 由steve02081504与Alex0125设计、编写
7975 转载时请在不对此文件做任何修改的同时注明出处
7976 项目地址:https://github.com/steve02081504/ELC
7977 */
7979 protected:
7981 virtual void* _abstract_method_get_resize_this(size_t size)=0;
7982 virtual void* _abstract_method_get_forward_resize_this(size_t size)=0;
7983
7986
7987 friend class get_n::unget_t;
7988 friend class get_n::get_resize_t;
7989 friend class get_n::get_size_of_get_t;
7990 friend class get_n::copy_get_t;
7991 };
7992
7993 //file_end
7994
7995 #line 20 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/abstract_base/_body.hpp"
7996 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/abstract_base/abstract_base.hpp"
7997 //abstract_base.hpp
7998 //at namespace elc::defs::memory::abstract_base_n
7999 /*
8000 未完成的elc解释器base文件
8001 由steve02081504与Alex0125设计、编写
8002 转载时请在不对此文件做任何修改的同时注明出处
8003 项目地址:https://github.com/steve02081504/ELC
8004 */
8005 template<class T>
8007 T* abstract_method_copy_get_this(){
8008 is_base_ptr(this);
8009 return reinterpret_cast<T*>(get_ptr_after_off_set(this->_abstract_method_copy_get_this()));
8010 }
8011 T* abstract_method_get_resize_this(size_t size){
8012 is_base_ptr(this);
8013 return reinterpret_cast<T*>(get_ptr_after_off_set(this->_abstract_method_get_resize_this(size)));
8014 }
8015 T* abstract_method_get_forward_resize_this(size_t size){
8016 is_base_ptr(this);
8017 return reinterpret_cast<T*>(get_ptr_after_off_set(this->_abstract_method_get_forward_resize_this(size)));
8018 }
8019
8020 friend class get_n::unget_t;
8023 friend class get_n::copy_get_t;
8024 };
8025
8026 //file_end
8027
8028 #line 21 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/abstract_base/_body.hpp"
8029 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/abstract_base/instance_struct.hpp"
8030 //instance_struct.hpp
8031 //at namespace elc::defs::memory::abstract_base_n
8032 /*
8033 未完成的elc解释器base文件
8034 由steve02081504与Alex0125设计、编写
8035 转载时请在不对此文件做任何修改的同时注明出处
8036 项目地址:https://github.com/steve02081504/ELC
8037 */
8038 push_and_disable_msvc_warning(26436);//无虚析构函数警告diss
8039 template<class T>
8040 class instance_struct:is_common_attribute(instance_struct),virtual public abstract_base_vtable{
8041 protected:
8042 virtual void abstract_method_unget_this()noexcept_as(unget(get_handle(this)))override{unget(get_handle(this));}
8043 virtual void* _abstract_method_copy_get_this()noexcept(copy_get.able<T>?copy_get.nothrow<T>:1)override{
8044 if constexpr(copy_get.able<T>){
8045 is_instance_ptr(this);
8046 return copy_get(get_handle(this));
8047 }
8048 else{
8049 return get_handle(this);
8050 }
8051 }
8052 virtual void* _abstract_method_get_resize_this(size_t size)noexcept(get_resize.able<T>?get_resize.nothrow<T>:1)override{
8053 if constexpr(get_resize.able<T>){
8054 is_instance_ptr(this);
8055 return get_resize(get_handle(this),size);
8056 }
8057 else{
8058 return get_handle(this);
8059 }
8060 }
8061 virtual void* _abstract_method_get_forward_resize_this(size_t size)noexcept(get_forward_resize.able<T>?get_forward_resize.nothrow<T>:1)override{
8062 if constexpr(get_forward_resize.able<T>){
8063 is_instance_ptr(this);
8064 return get_forward_resize(get_handle(this),size);
8065 }
8066 else{
8067 return get_handle(this);
8068 }
8069 }
8070 virtual size_t abstract_method_get_size_of_get_for_this()noexcept override{return get_size_of_get(get_handle(this));}
8071 };
8073
8074 //file_end
8075
8076 #line 22 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/abstract_base/_body.hpp"
8077 }
8078 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/abstract_base/_export.hpp"
8079 //_export.hpp
8080 //at namespace elc::defs::memory
8081 /*
8082 未完成的elc解释器base文件
8083 由steve02081504与Alex0125设计、编写
8084 转载时请在不对此文件做任何修改的同时注明出处
8085 项目地址:https://github.com/steve02081504/ELC
8086 */
8087 #define export using abstract_base_n::
8088 export abstract_base;
8089 export instance_struct;
8090 #undef export
8091
8092 //file_end
8093
8094 #line 24 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/abstract_base/_body.hpp"
8095
8096 //file_end
8097
8098 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/_body.hpp"
8099
8100 //#include "pool/_body.hpp"//依赖list
8101
8102 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/_body.hpp"
8103 //_body.hpp
8104 //at namespace elc::defs::memory
8105 /*
8106 未完成的elc解释器base文件
8107 由steve02081504与Alex0125设计、编写
8108 转载时请在不对此文件做任何修改的同时注明出处
8109 项目地址:https://github.com/steve02081504/ELC
8110 */
8111 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/defs.hpp"
8112 //defs.hpp
8113 //at namespace elc::defs::memory
8114 /*
8115 未完成的elc解释器base文件
8116 由steve02081504与Alex0125设计、编写
8117 转载时请在不对此文件做任何修改的同时注明出处
8118 项目地址:https://github.com/steve02081504/ELC
8119 */
8120 namespace others_n{
8121 template<typename T>
8122 struct replace_able;
8123 }
8125 namespace ptr_n{
8126 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/ref/_body.hpp"
8127 //_body.hpp
8128 //at namespace elc::defs::memory::ptr_n
8129 /*
8130 未完成的elc解释器base文件
8131 由steve02081504与Alex0125设计、编写
8132 转载时请在不对此文件做任何修改的同时注明出处
8133 项目地址:https://github.com/steve02081504/ELC
8134 */
8135 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/ref/ref_t.hpp"
8136 //ref_t.hpp
8137 //at namespace elc::defs::memory::ptr_n
8138 /*
8139 未完成的elc解释器base文件
8140 由steve02081504与Alex0125设计、编写
8141 转载时请在不对此文件做任何修改的同时注明出处
8142 项目地址:https://github.com/steve02081504/ELC
8143 */
8144 typedef ::std::size_t link_num_t;
8146 mutable link_num_t _ref_num=0;
8147 public:
8148 constexpr ref_t()noexcept=default;
8149 constexpr explicit ref_t(never_ref_num_zero_t)noexcept:_ref_num(1){}
8150 constexpr inline void add_ref()const noexcept{_ref_num++;}
8151 [[nodiscard]]inline bool cut_ref()const noexcept{return!--_ref_num;}
8152 //[[nodiscard]]operator bool()const noexcept{return _ref_num;}
8153 inline void set_zero()noexcept{_ref_num=0;}
8154 constexpr inline void init_never_ref_num_zero()noexcept{add_ref();}
8155 [[nodiscard]]link_num_t link_num()const noexcept{return _ref_num;}
8156 };
8157
8158 //file_end
8159
8160 #line 9 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/ref/_body.hpp"
8161 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/ref/ref_base.hpp"
8162 //ref_base.hpp
8163 //at namespace elc::defs::memory::ptr_n
8164 /*
8165 未完成的elc解释器base文件
8166 由steve02081504与Alex0125设计、编写
8167 转载时请在不对此文件做任何修改的同时注明出处
8168 项目地址:https://github.com/steve02081504/ELC
8169 */
8170 enable_adl(the_waiting_for_destroy);
8171 template<typename T>
8172 void waiting_for_destroy(T*a)noexcept{
8174 return the_waiting_for_destroy(a);
8175 else
8176 template_error("this function should not be instantiated,please overload the function the_waiting_for_destroy in the namespace where this type is defined.");
8177 }
8178 enable_adl(the_destroy_and_free);
8179 template<typename T>
8180 void destroy_and_free(T*a)noexcept{
8182 return the_destroy_and_free(a);
8183 elseif constexpr(type_info<T>.has_attribute(build_by_get_only)&&type_info<T>.has_attribute(never_in_array))
8184 unget(a);
8185 else
8186 template_error("please overload the function the_destroy_and_free in the namespace where this type is defined.");
8187 }
8188 //
8189 common_attribute_t ref_able;
8190 common_attribute_t weak_ref_able;
8191
8192 template<typename T>
8193 constexpr bool was_ref_able=type_info<T>.has_attribute(ref_able);
8194 template<typename T>
8195 constexpr bool was_weak_ref_able=type_info<T>.has_attribute(weak_ref_able);
8196
8197 template<typename T>
8198 [[nodiscard]]link_num_t get_ref_num(const T*a)noexcept{
8199 if constexpr(!was_ref_able<T>)
8200 template_error("hey.");
8201 return attribute_ptr_cast<const ref_able>(a)->link_num();
8202 }
8203 template<typename T>
8204 [[nodiscard]]link_num_t get_weak_ref_num(const T*a)noexcept{
8205 if constexpr(!was_weak_ref_able<T>)
8206 template_error("hey.");
8207 return attribute_ptr_cast<const weak_ref_able>(a)->link_num();
8208 }
8209
8210 //file_end
8211
8212 #line 10 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/ref/_body.hpp"
8213 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/ref/ref_able.hpp"
8214 //ref_able.hpp
8215 //at namespace elc::defs::memory::ptr_n
8216 /*
8217 未完成的elc解释器base文件
8218 由steve02081504与Alex0125设计、编写
8219 转载时请在不对此文件做任何修改的同时注明出处
8220 项目地址:https://github.com/steve02081504/ELC
8221 */
8222 template<typename T>
8224 private:
8225 typedef ref_t base_t;
8226 public:
8227 using base_t::base_t;
8228 inline void cut_ref()const noexcept{
8229 T*this_T=remove_const(get_handle(this));
8230 if(base_t::cut_ref())
8231 if constexpr(was_weak_ref_able<T>)
8232 if(get_weak_ref_num(this_T)!=0)
8233 waiting_for_destroy(this_T);
8234 else
8235 destroy_and_free(this_T);
8236 else
8237 destroy_and_free(this_T);
8238 }
8239 };
8240
8241 //file_end
8242
8243 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/ref/_body.hpp"
8244 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/ref/weak_ref_able.hpp"
8245 //weak_ref_able.hpp
8246 //at namespace elc::defs::memory::ptr_n
8247 /*
8248 未完成的elc解释器base文件
8249 由steve02081504与Alex0125设计、编写
8250 转载时请在不对此文件做任何修改的同时注明出处
8251 项目地址:https://github.com/steve02081504/ELC
8252 */
8253 template<typename T>
8255 private:
8256 typedef ref_t base_t;
8257 public:
8258 inline void cut_ref()const noexcept{
8259 if constexpr(!was_ref_able<T>)
8260 template_error("base on ref_able before base on weak_ref_able,please.");
8261 T*this_T=remove_const(get_handle(this));
8262 if(base_t::cut_ref())
8263 if(get_ref_num(this_T)==0)
8264 destroy_and_free(this_T);
8265 }
8266 };
8267
8268 //file_end
8269
8270 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/ref/_body.hpp"
8271
8272 //file_end
8273
8274 #line 15 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/defs.hpp"
8275 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/ptr/_body.hpp"
8276 //_body.hpp
8277 //at namespace elc::defs::memory::ptr_n
8278 /*
8279 未完成的elc解释器base文件
8280 由steve02081504与Alex0125设计、编写
8281 转载时请在不对此文件做任何修改的同时注明出处
8282 项目地址:https://github.com/steve02081504/ELC
8283 */
8284 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/ptr/base_ptr_t.hpp"
8285 //base_ptr_t.hpp
8286 //at namespace elc::defs::memory::ptr_n
8287 /*
8288 未完成的elc解释器base文件
8289 由steve02081504与Alex0125设计、编写
8290 转载时请在不对此文件做任何修改的同时注明出处
8291 项目地址:https://github.com/steve02081504/ELC
8292 */
8293 //copy from old ELC & adepted.
8294 template<class T>
8296 protected:
8297 mutable T*_to;
8298 explicit same_ptr_p_t(T*a)noexcept:_to(a){}
8299 public:
8300 same_ptr_p_t(const same_ptr_p_t&)noexcept=default;
8301 [[nodiscard]]T*get()const noexcept{return _to;}
8302 };
8303 template<class T,typename ref_type>
8305 using same_ptr_p_t<T>::_to;
8306 explicit same_ref_p_t(T*a)noexcept:same_ptr_p_t<T>(a){}
8307 explicit same_ref_p_t(const same_ptr_p_t<T>&a)noexcept:same_ptr_p_t<T>(a){}
8308
8309 void swap_with(same_ref_p_t&a)noexcept{swap(_to,a._to);}
8310
8311 static constexpr bool cut_nothrow=noexcept(declvalue(ref_type).cut_ref());
8312 protected:
8313 static void cut_ref(T*a)noexcept(cut_nothrow){attribute_ptr_cast<ref_type>(a)->cut_ref();}
8314 static void add_ref(T*a)noexcept{attribute_ptr_cast<ref_type>(a)->add_ref();}
8315
8316 void cut_ref()const noexcept_as(cut_ref(nullptr)){cut_ref(_to);}
8317 void add_ref()const noexcept{add_ref(_to);}
8318 };
8319
8320 template<class T,typename ref_type>
8322 a.swap_with(b);
8323 }
8324
8325 template<class T,typename ref_type,bool do_replace_check>
8326 struct ptr_t:same_ref_p_t<T,ref_type>{
8328
8332 using base_t::cut_nothrow;
8333 using same_ref::add_ref;
8334 using same_ref::cut_ref;
8335 using same_ref::swap_with;
8336 using same_ptr::_to;
8337
8338 explicit ptr_t(T*a,special_init_t)noexcept:same_ref(a){}
8339 constexpr ptr_t(T*a)noexcept:same_ref(a){add_ref();}
8340 ptr_t(const same_ptr&a)noexcept:same_ref(a){
8341 if constexpr(type_info<T>.has_attribute(weak_ref_able) && type_info<ref_type> == type_info<ref_able<remove_cv<T>>>)
8342 if(get_ref_num(_to))
8343 add_ref();
8344 else
8345 add_ref(_to=null_ptr);
8346 else
8347 add_ref();
8348 }
8349 ptr_t(const same_ref&a)noexcept:same_ref(a){add_ref();}
8350 ptr_t(const ptr_t&a)noexcept:ptr_t((same_ptr&)a){}
8351 ptr_t(const ptr_t<remove_cv<T>,ref_type,do_replace_check>&a)noexcept requires(type_info<remove_cv<T>>!=type_info<T>):ptr_t(a.get()){}
8352 ptr_t(ptr_t&&a)noexcept:ptr_t((same_ptr&)a){
8353 //为什么不默认构造后swap_with?
8354 /*
8355 直接构造:
8356 对目标进行addref
8357 移动对象析构(单次cutref)
8358 总耗费4
8359 默认构造后swap_with:
8360 对nullptr进行addref
8361 交换ptr值
8362 移动对象析构(单次cutref)
8363 总耗费6
8364
8365 总结:多此一举
8366 */
8367 }
8368 constexpr ptr_t(nullptr_t=nullptr)noexcept:ptr_t(null_ptr){}
8369 constexpr ptr_t(null_ptr_t)noexcept:ptr_t((T*)(null_ptr)){}
8370 ~ptr_t()noexcept(cut_nothrow){cut_ref();}
8371
8372 static constexpr bool reset_nothrow=cut_nothrow;
8373 void reset(T*a)const noexcept(reset_nothrow){auto tmp=_to;add_ref(_to=a);cut_ref(tmp);}
8374 void reset(nullptr_t=nullptr)const noexcept(reset_nothrow){reset(null_ptr);}
8375 public:
8376 static constexpr bool replace_check_nothrow=(type_info<T>.not_has_attribute(replace_able))||reset_nothrow;
8377 inline void replace_check()const noexcept(replace_check_nothrow){
8378 if constexpr(do_replace_check&&type_info<remove_cvref<T>>.has_attribute(replace_able))
8379 if(attribute_ptr_cast<replace_able>(_to)->replaced())
8380 reset(attribute_ptr_cast<replace_able>(_to)->get_ptr());
8381 }
8382 inline void do_replace(T*p)noexcept(replace_check_nothrow&&reset_nothrow){
8383 if constexpr(type_info<remove_cvref<T>>.has_attribute(replace_able)){
8384 attribute_ptr_cast<replace_able>(_to)->be_replace_as(p);
8385 reset(p);
8386 }
8387 }
8388 template<typename ref_type_,bool do_replace_check_>
8389 inline void do_replace(const ptr_t<T,ref_type_,do_replace_check_>&p)noexcept(replace_check_nothrow&&reset_nothrow){
8390 do_replace(p.get());
8391 }
8392 static constexpr bool get_nothrow=replace_check_nothrow;
8393 [[nodiscard]]T*get()const noexcept(get_nothrow){
8394 replace_check();
8395 return base_t::get();
8396 }
8397 [[nodiscard]]bool unique()const noexcept{return attribute_ptr_cast<ref_able>(get())->link_num()==1;}
8398 [[nodiscard]]constexpr
8400 unstable_hash_t,hash_t> hash()const noexcept_as(elc::defs::hash(get())){//注意:当T可replace时,同一ptr的hash可能变动
8401 using elc::defs::hash;
8402 return hash(get());
8403 }
8404
8405 [[nodiscard]]inline auto operator==(const T*a)const noexcept_as(pointer_equal(add_const(declvalue(const this_t&).get()),a)){
8406 return pointer_equal(add_const(get()),a);
8407 }
8408 [[nodiscard]]inline auto operator==(nullptr_t)const noexcept_as(operator==(null_ptr)){
8409 return operator==(null_ptr);
8410 }
8411 [[nodiscard]]inline auto operator==(null_ptr_t)const noexcept_as(operator==((T*)null_ptr)){
8412 return operator==((T*)null_ptr);
8413 }
8414 template<typename ref_type_,bool do_replace_check_>
8415 [[nodiscard]]inline auto operator==(const ptr_t<T,ref_type_,do_replace_check_>&b)const
8417 declvalue(const this_t&).get(),
8418 b.get())
8419 ){
8420 return pointer_equal(get(),b.get());
8421 }
8422 template<typename ref_type_,bool do_replace_check_> requires(type_info<remove_cv<T>>!=type_info<T>)
8423 [[nodiscard]]inline auto operator==(const ptr_t<const T,ref_type_,do_replace_check_>&b)const
8425 declvalue(const this_t&).get(),
8426 b.get())
8427 ){
8428 return pointer_equal(get(),b.get());
8429 }
8430 template<typename ref_type_,bool do_replace_check_> requires(type_info<remove_cv<T>>!=type_info<T>)
8431 [[nodiscard]]inline auto operator==(const ptr_t<remove_cv<T>,ref_type_,do_replace_check_>&b)const
8433 declvalue(const this_t&).get(),
8434 add_const(b.get()))
8435 ){
8436 return pointer_equal(get(),add_const(b.get()));
8437 }
8438 };
8439
8440 template<typename T_,typename T,typename ref_type,bool do_replace_check,enable_if(type_info<T_>.base_on<T>)>
8441 [[nodiscard]]inline auto operator==(const T_*a,ptr_t<T,ref_type,do_replace_check>&b)noexcept_as(b.operator==(static_cast<const T*>(a))){
8442 return b.operator==(static_cast<const T*>(a));
8443 }
8444
8445 template<typename T,typename T_> requires(equal.able<T,T_>)
8446 [[nodiscard]]inline auto operator!=(T&&a,T_&&b)noexcept_as(!(a==b)){
8447 return !(a==b);
8448 }
8449
8450 template<class T,typename ref_type,bool do_replace_check>
8451 struct base_ptr_t:ptr_t<T,ref_type,do_replace_check>{
8452 static_assert(type_info<T>.base_on<ref_type>);
8455 using typename base_t::same_ref;
8456 using typename base_t::same_ptr;
8457 using base_t::reset;
8458 using base_t::get;
8459 using same_ref::swap_with;
8460 using same_ptr::_to;
8461
8462 using base_t::get_nothrow;
8463 using base_t::reset_nothrow;
8464
8466
8468 base_ptr_t(base_ptr_t&&a)noexcept:base_t(move(a)){}
8469
8470 [[nodiscard]]T*operator->()const noexcept(get_nothrow){return get();}
8471 [[nodiscard]]T&operator*()const noexcept(get_nothrow){return*get();}
8472 [[nodiscard]]explicit operator bool()const noexcept(get_nothrow){return bool(pointer_to_bool(get()));}
8473 [[nodiscard]]auto operator!()const noexcept(get_nothrow){return!pointer_to_bool(get());}
8474 [[nodiscard]]explicit operator T*()const noexcept(get_nothrow){return get();}
8475
8476 base_ptr_t&operator=(T*a)&noexcept(reset_nothrow){reset(a);return*this;}
8477 base_ptr_t&operator=(const same_ptr&a)&noexcept(reset_nothrow&&get_nothrow){reset(a.get());return*this;}
8478 base_ptr_t&operator=(const base_ptr_t&a)&noexcept(reset_nothrow&&get_nothrow){reset(a.get());return*this;}
8479 base_ptr_t&operator=(same_ref&&a)&noexcept{swap_with(a);return*this;}
8480 base_ptr_t&operator=(base_ptr_t&&a)&noexcept{swap_with(a);return*this;}
8481 base_ptr_t&operator=(null_ptr_t)&noexcept(reset_nothrow){return*this=(T*)null_ptr;}
8482 base_ptr_t&operator=(nullptr_t)&noexcept(reset_nothrow){return*this=null_ptr;}
8483
8484 private:
8485 static inline thread_local class for_delete_t{
8486 T*_m;
8487 friend class this_t;
8488 for_delete_t*operator()(T*a)noexcept{
8489 _m=a;
8490 return this;
8491 }
8492 public:
8493 static void operator delete(void*a)noexcept_as(destroy(declvalue(T*))){
8494 destroy(reinterpret_cast<for_delete_t*>(a)->_m);
8495 }
8496 }for_delete{};
8497 public:
8498 [[nodiscard]]explicit operator bool()noexcept(get_nothrow){return add_const(this)->operator bool();}
8499 [[nodiscard]]distinctive operator for_delete_t*()noexcept(get_nothrow){return for_delete(get());}
8500
8501 template<typename...Args> requires(invoke<T>.able<Args...>)
8502 inline auto operator()(Args&&... rest)noexcept(invoke<T>.nothrow<Args...>){return(operator*())(forward<Args>(rest)...);}
8503 };
8504
8505 //file_end
8506
8507 #line 9 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/ptr/_body.hpp"
8508 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/ptr/comn_ptr_t.hpp"
8509 //comn_ptr_t.hpp
8510 //at namespace elc::defs::memory::ptr_n
8511 /*
8512 未完成的elc解释器base文件
8513 由steve02081504与Alex0125设计、编写
8514 转载时请在不对此文件做任何修改的同时注明出处
8515 项目地址:https://github.com/steve02081504/ELC
8516 */
8517 template<typename T>
8519
8520 //file_end
8521
8522 #line 10 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/ptr/_body.hpp"
8523 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/ptr/weak_ptr_t.hpp"
8524 //weak_ptr_t.hpp
8525 //at namespace elc::defs::memory::ptr_n
8526 /*
8527 未完成的elc解释器base文件
8528 由steve02081504与Alex0125设计、编写
8529 转载时请在不对此文件做任何修改的同时注明出处
8530 项目地址:https://github.com/steve02081504/ELC
8531 */
8532 template<typename T>
8534
8535 //file_end
8536
8537 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/ptr/_body.hpp"
8538 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/ptr/nocheck_ptr_t.hpp"
8539 //nocheck_ptr_t.hpp
8540 //at namespace elc::defs::memory::ptr_n
8541 /*
8542 未完成的elc解释器base文件
8543 由steve02081504与Alex0125设计、编写
8544 转载时请在不对此文件做任何修改的同时注明出处
8545 项目地址:https://github.com/steve02081504/ELC
8546 */
8547 template<typename T>
8549
8550 //file_end
8551
8552 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/ptr/_body.hpp"
8553 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/ptr/deduction_guides.hpp"
8554 //deduction_guides.hpp
8555 //at namespace elc::defs::memory::ptr_n
8556 /*
8557 未完成的elc解释器base文件
8558 由steve02081504与Alex0125设计、编写
8559 转载时请在不对此文件做任何修改的同时注明出处
8560 项目地址:https://github.com/steve02081504/ELC
8561 */
8562 template<class T,common_attribute_t ref_type,bool has_check>
8563 base_ptr_t(T*) -> base_ptr_t<remove_cvref<T>,ref_type<remove_cvref<T>>,has_check>;
8564
8565 template<class T,common_attribute_t ref_type,bool has_check>
8567
8568 //file_end
8569
8570 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/ptr/_body.hpp"
8571
8572 //file_end
8573
8574 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/defs.hpp"
8575 }
8576
8577 //file_end
8578
8579 #line 9 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/_body.hpp"
8580 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/_export.hpp"
8581 //_export.hpp
8582 //at namespace elc
8583 /*
8584 未完成的elc解释器base文件
8585 由steve02081504与Alex0125设计、编写
8586 转载时请在不对此文件做任何修改的同时注明出处
8587 项目地址:https://github.com/steve02081504/ELC
8588 */
8589 #define export using ptr_n::
8590 export ref_able;
8591 export weak_ref_able;
8592 export base_ptr_t;
8593 export comn_ptr_t;
8594 export weak_ptr_t;
8595 #undef export
8596
8597 //file_end
8598
8599 #line 10 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/_body.hpp"
8600 #if defined(ELC_TEST_ON)
8601 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/_test.hpp"
8602 //_test.hpp
8603 //at namespace elc::defs::memory::ptr_n
8604 /*
8605 未完成的elc解释器base文件
8606 由steve02081504与Alex0125设计、编写
8607 转载时请在不对此文件做任何修改的同时注明出处
8608 项目地址:https://github.com/steve02081504/ELC
8609 */
8610 namespace ptr_n{
8611 struct tester:type_info_t<tester>::template_name
8612 with_common_attribute<ref_able,weak_ref_able,never_in_array>,build_by_get_only{};
8613 void waiting_for_destroy(tester*)noexcept{}
8614 inline void test(){
8615 ELC_TEST_EVENTNAME("ptr部分测试");
8616 {
8617 comn_ptr_t a=get<tester>();
8618 weak_ptr_t b=a;
8619 }
8620 check_memory_lack();
8621 }
8622 inline void test_log_out(){
8623 }
8624 inline void test_end(){
8625 }
8626 }
8627
8628 //file_end
8629
8630 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/_body.hpp"
8631 #endif
8632
8633 //file_end
8634
8635 #line 15 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/_body.hpp"
8636 //依赖list
8637 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/other/_body.hpp"
8638 //_body.hpp
8639 //at namespace elc::defs::memory
8640 /*
8641 未完成的elc解释器base文件
8642 由steve02081504与Alex0125设计、编写
8643 转载时请在不对此文件做任何修改的同时注明出处
8644 项目地址:https://github.com/steve02081504/ELC
8645 */
8646 namespace others_n{
8647 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/other/replace_able.hpp"
8648 //replace_able.hpp
8649 //at namespace elc::defs::memory::others_n
8650 /*
8651 未完成的elc解释器base文件
8652 由steve02081504与Alex0125设计、编写
8653 转载时请在不对此文件做任何修改的同时注明出处
8654 项目地址:https://github.com/steve02081504/ELC
8655 */
8656 //此属性配合 "../ptr" 食用
8657 template<typename T>
8659 private:
8660 mutable T*_m;
8661 public:
8662 constexpr replace_able()noexcept:_m(get_handle(this)){}
8663 constexpr ~replace_able()noexcept{
8664 if(replaced())
8665 attribute_ptr_cast<ref_able>(_m)->cut_ref();
8666 }
8667 constexpr bool replaced()const noexcept{return _m!=get_handle(this);}
8668 constexpr T*get_ptr()const noexcept{
8669 if(!replaced())
8670 return _m;
8671 else
8672 return attribute_ptr_cast<replace_able>(_m)->get_ptr();
8673 }
8674 constexpr void be_replace_as(T*new_p)noexcept{
8675 if(replaced())
8676 attribute_ptr_cast<ref_able>(_m)->cut_ref();
8677 _m=new_p;
8678 if(replaced())
8679 attribute_ptr_cast<ref_able>(_m)->add_ref();
8680 }
8681 constexpr void be_replace_as(nullptr_t)noexcept{be_replace_as(null_ptr);}
8682 };
8683
8684 //file_end
8685
8686 #line 10 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/other/_body.hpp"
8687 //依赖list
8688 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/other/can_map_all.hpp"
8689 //can_map_all.hpp
8690 //at namespace elc::defs::memory::others_n
8691 /*
8692 未完成的elc解释器base文件
8693 由steve02081504与Alex0125设计、编写
8694 转载时请在不对此文件做任何修改的同时注明出处
8695 项目地址:https://github.com/steve02081504/ELC
8696 */
8697 template<typename T>
8698 struct can_map_all:cons_t<can_map_all<T>>,is_common_attribute(can_map_all){
8700 private:
8701 distinctive inline static list_t<this_t> type_list;
8702
8703 template<class,class func_t>
8704 friend inline void map_all_helper(func_t&&a);
8705 public:
8706 constexpr can_map_all(){
8707 type_list.add(this);
8708 }
8709 };
8710 template<class T,class func_t>
8711 inline void map_all_helper(func_t&&a){
8712 auto tmp=can_map_all<T>::type_list.begin();
8713 auto end=can_map_all<T>::type_list.end();
8714 while(tmp!=end){
8715 a(get_handle<T,can_map_all>(tmp++));
8716 }
8717 }
8718 #define expr declvalue(func_t)(declvalue(T*))
8719 template<class T,class func_t,enable_if(was_not_an_ill_form(expr))>
8720 inline void map_all(func_t&&a)noexcept_as(expr){
8721 map_all_helper<T,func_t>(forward<func_t>(a));
8722 }
8723 #undef expr
8724
8725 //file_end
8726
8727 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/other/_body.hpp"
8728 }
8729
8730 //file_end
8731
8732 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/_body.hpp"
8733
8734 //#include "gc/_body.hpp"//NOTE:gc不在此处定义,因为它依赖container
8735
8736 #if defined(ELC_TEST_ON)
8737 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/_test.hpp"
8738 //_test.hpp
8739 //at namespace elc::defs::memory
8740 /*
8741 未完成的elc解释器base文件
8742 由steve02081504与Alex0125设计、编写
8743 转载时请在不对此文件做任何修改的同时注明出处
8744 项目地址:https://github.com/steve02081504/ELC
8745 */
8746 inline void test(){
8747 ELC_TEST_EVENTNAME("memory部分测试");
8748 alloc_n::test();
8749 lifetime_n::test();
8750 get_n::test();
8751 //pool_n::test();
8752 }
8753 inline void test_log_out(){
8754 alloc_n::test_log_out();
8755 lifetime_n::test_log_out();
8756 get_n::test_log_out();
8757 //pool_n::test_log_out();
8758 }
8759 inline void test_end(){
8760 alloc_n::test_end();
8761 lifetime_n::test_end();
8762 get_n::test_end();
8763 //pool_n::test_end();
8764 }
8765
8766 //file_end
8767
8768 #line 21 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/_body.hpp"
8769 #endif
8770
8771 //file_end
8772
8773 #line 30 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/_body.hpp"
8774 }
8775 using namespace memory;
8776
8777 namespace container{
8778 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/_body.hpp"
8779 //_body.hpp
8780 //at namespace elc::defs::container
8781 /*
8782 未完成的elc解释器base文件
8783 由steve02081504与Alex0125设计、编写
8784 转载时请在不对此文件做任何修改的同时注明出处
8785 项目地址:https://github.com/steve02081504/ELC
8786 */
8787 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/array/_body.hpp"
8788 //_body.hpp
8789 //at namespace elc::defs::container
8790 /*
8791 未完成的elc解释器base文件
8792 由steve02081504与Alex0125设计、编写
8793 转载时请在不对此文件做任何修改的同时注明出处
8794 项目地址:https://github.com/steve02081504/ELC
8795 */
8796 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/array/defs.hpp"
8797 //defs.hpp
8798 //at namespace elc::defs::container
8799 /*
8800 未完成的elc解释器base文件
8801 由steve02081504与Alex0125设计、编写
8802 转载时请在不对此文件做任何修改的同时注明出处
8803 项目地址:https://github.com/steve02081504/ELC
8804 */
8805 namespace array_n{
8806 template<typename T>
8807 class array_t{
8808 typedef array_t<T>this_t;
8809 T*_m;
8810 #if defined(DEBUG) || defined(_DEBUG)
8811 size_t _size_for_debug_view=0;
8812 #endif
8813
8814 #if defined(DEBUG) || defined(_DEBUG)
8815 /*return{ptr,size};*/
8816 constexpr array_t(T*a,size_t s):_m(a),_size_for_debug_view(s){}
8817 #else
8818 /*return{ptr};*/
8819 constexpr array_t(T*a):_m(a){}
8820 #endif
8821 /*返回一个自身的副本*/
8822 [[nodiscard]]this_t copy()const noexcept(copy_get.nothrow<T>) requires(copy_get.able<T>){
8823 #if defined(DEBUG) || defined(_DEBUG)
8824 return{copy_get(_m),_size_for_debug_view};
8825 #else
8826 return{copy_get(_m)};
8827 #endif
8828 }
8829 public:
8830 void swap_with(this_t&a)noexcept{
8831 swap(_m,a._m);
8832 #if defined(DEBUG) || defined(_DEBUG)
8833 swap(_size_for_debug_view,a._size_for_debug_view);
8834 #endif
8835 }
8836 public:
8837 /*默认构造*/
8838 constexpr array_t()noexcept:_m(null_ptr){}
8839 /*
8840 构造size个T
8841 */
8842 explicit array_t(note::size_t<size_t>size)noexcept(get<T>.nothrow<>){
8843 _m=get<T>[size.value]();
8844 #if defined(DEBUG) || defined(_DEBUG)
8845 _size_for_debug_view=size.value;
8846 #endif
8847 }
8848 explicit array_t(note::size_t<size_t>size,const T&elem)noexcept(get<T>.nothrow<>){
8849 _m=get<T>[size.value](elem);
8850 #if defined(DEBUG) || defined(_DEBUG)
8851 _size_for_debug_view=size.value;
8852 #endif
8853 }
8854 /*
8855 此重载适用于T[N],std::init_list<T>以及range_t<const T*>
8856 */
8857 //template<as_concept<get<T>.as_array.able> U>
8858 template<class U> requires(get<T>.as_array.able<U>)
8859 array_t(U&&a)noexcept(get<T>.as_array.nothrow<U>){
8860 _m=get<T>.as_array(forward<U>(a));
8861 #if defined(DEBUG) || defined(_DEBUG)
8862 _size_for_debug_view=size();
8863 #endif
8864 }
8865
8866 //复制和移动函数
8867 array_t(const this_t&a)noexcept_as(declvalue(this_t).copy()):array_t(a.copy()){}
8869 return operator=(a.copy());
8870 }
8871 array_t(this_t&&a)noexcept:array_t(){swap_with(a);}
8873 swap_with(a);
8874 return*this;
8875 }
8876
8877 ~array_t()noexcept(unget.nothrow<T>){
8878 unget(_m);
8879 }
8880 [[nodiscard]]size_t size()const noexcept{
8881 return get_size_of_get(_m);
8882 }
8883 [[nodiscard]]size_t size_in_byte()const noexcept{
8884 return size()*sizeof(T);
8885 }
8886 static constexpr bool resize_nothrow = get_resize.nothrow<T>;
8887 void resize(size_t size)noexcept(resize_nothrow){
8888 get_resize(_m,size);
8889 #if defined(DEBUG) || defined(_DEBUG)
8890 _size_for_debug_view=size;
8891 #endif
8892 }
8893 static constexpr bool forward_resize_nothrow = get_forward_resize.nothrow<T>;
8894 void forward_resize(size_t size)noexcept(forward_resize_nothrow){
8895 get_forward_resize(_m,size);
8896 #if defined(DEBUG) || defined(_DEBUG)
8897 _size_for_debug_view=size;
8898 #endif
8899 }
8900 static constexpr bool insert_nothrow = get_resize.insert.nothrow<T>;
8901 void insert(size_t index,size_t count)noexcept(insert_nothrow){
8902 get_resize.insert(_m,index,count);
8903 #if defined(DEBUG) || defined(_DEBUG)
8904 _size_for_debug_view+=count;
8905 #endif
8906 }
8907 void insert(size_t index,size_t count,const T*data)noexcept(insert_nothrow){
8908 get_resize.insert(_m,index,count,data);
8909 #if defined(DEBUG) || defined(_DEBUG)
8910 _size_for_debug_view+=count;
8911 #endif
8912 }
8913 void insert_with_resize(size_t index,size_t count,const T*data,size_t new_size)noexcept(insert_nothrow){
8914 get_resize.insert_with_resize(_m,index,count,data,new_size);
8915 #if defined(DEBUG) || defined(_DEBUG)
8916 _size_for_debug_view=new_size;
8917 #endif
8918 }
8919 static constexpr bool insert_with_forward_resize_nothrow = get_forward_resize.insert_with_resize.nothrow<T>;
8920 void insert_with_forward_resize(size_t index,size_t count,const T*data,size_t new_size)noexcept(insert_with_forward_resize_nothrow){
8921 get_forward_resize.insert_with_resize(_m,index,count,data,new_size);
8922 #if defined(DEBUG) || defined(_DEBUG)
8923 _size_for_debug_view=new_size;
8924 #endif
8925 }
8926 [[nodiscard]]bool empty()const{
8927 return _m==null_ptr;
8928 }
8929 void clear()noexcept(re_construct.nothrow<this_t>){
8930 re_construct(this);
8931 }
8932 [[nodiscard]]T&operator[](size_t pos)noexcept{return _m[pos];}
8933 [[nodiscard]]const T&operator[](size_t pos)const noexcept{return _m[pos];}
8934 [[nodiscard]]explicit operator hash_t()const noexcept(hash.nothrow<T>){return hash(_m,size());}
8935 [[nodiscard]]explicit operator T*()noexcept{return _m;}
8936 [[nodiscard]]explicit operator const T*()const noexcept{return _m;}
8937
8938 typedef iterator_t<T>iterator;
8939 typedef const_iterator_t<T>const_iterator;
8940
8941 [[nodiscard]]constexpr iterator get_iterator_at(size_t a)noexcept{
8942 return _m+a;
8943 }
8944 [[nodiscard]]constexpr const_iterator get_iterator_at(size_t a)const noexcept{
8945 return _m+a;
8946 }
8947 [[nodiscard]]constexpr iterator begin()noexcept{
8948 return get_iterator_at(zero);
8949 }
8950 [[nodiscard]]iterator end()noexcept{
8951 return get_iterator_at(size());
8952 }
8953 [[nodiscard]]constexpr const_iterator begin()const noexcept{
8954 return get_iterator_at(zero);
8955 }
8956 [[nodiscard]]const_iterator end()const noexcept{
8957 return get_iterator_at(size());
8958 }
8959 [[nodiscard]]const_iterator cbegin()const noexcept{
8960 return begin();
8961 }
8962 [[nodiscard]]const_iterator cend()const noexcept{
8963 return end();
8964 }
8965
8966 [[nodiscard]]constexpr auto operator<=>(array_like_view_t<const T> a)const noexcept(compare.nothrow<array_like_view_t<T>>){
8967 return compare(array_like_view_t<const T>(*this),a);
8968 }
8969 [[nodiscard]]constexpr auto operator==(array_like_view_t<const T> a)const noexcept(equal.nothrow<array_like_view_t<T>>){
8970 return equal(array_like_view_t<const T>(*this),a);
8971 }
8972 [[nodiscard]]constexpr auto operator<=>(const this_t&a)const noexcept(compare.nothrow<array_like_view_t<T>>){
8973 return operator<=>(array_like_view_t<const T>(a));
8974 }
8975 [[nodiscard]]constexpr auto operator==(const this_t&a)const noexcept(equal.nothrow<array_like_view_t<T>>){
8977 }
8978
8979 #define expr declvalue(func_t)(declvalue(T&))
8980 template<typename func_t> requires was_not_an_ill_form(expr)
8981 void for_each(func_t&&func)noexcept_as(expr){
8982 auto asize=size();
8983 while(asize--)
8984 func((*this)[asize]);
8985 }
8986 #undef expr
8987
8988 #define expr declvalue(func_t)(declvalue(const T&))
8989 template<typename func_t> requires was_not_an_ill_form(expr)
8990 void for_each(func_t&&func)const noexcept_as(expr){
8991 auto asize=size();
8992 while(asize--)
8993 func((*this)[asize]);
8994 }
8995 #undef expr
8996
8997 void push_back(const T&a){
8998 get<T>.apply_end(note::to<T*&>(_m),a);
8999 #if defined(DEBUG) || defined(_DEBUG)
9000 _size_for_debug_view=size();
9001 #endif
9002 }
9003 void push_back(T&&a){
9004 get<T>.apply_end(note::to<T*&>(_m),move(a));
9005 #if defined(DEBUG) || defined(_DEBUG)
9006 _size_for_debug_view=size();
9007 #endif
9008 }
9009 void remove(T a){
9010 get<T>.remove(a,note::from(_m));
9011 #if defined(DEBUG) || defined(_DEBUG)
9012 _size_for_debug_view=size();
9013 #endif
9014 }
9015 //template<as_concept<get<T>.apply_end.able> U>
9016 template<class U,enable_if(get<T>.apply_end.able)>
9017 friend this_t&operator+=(this_t&a,U&&b)noexcept(get<T>.apply_end.nothrow<U>){
9018 get<T>.apply_end(note::to(a._m),b);
9019 return a;
9020 }
9021 friend this_t&operator+=(this_t&a,zero_t b)noexcept(get<T>.apply_end.nothrow<T>){
9022 return a+=T(0);
9023 }
9024 template<typename U>
9025 friend this_t operator+(const this_t&a,U&&b)noexcept_as(a.copy()+=b) requires was_not_an_ill_form(a.copy()+=b){
9026 return a.copy()+=b;
9027 }
9028 template<typename U>
9029 friend this_t operator+(U&&a,const this_t&b)noexcept_as(this_t(a)+=b) requires was_not_an_ill_form(this_t(a)+=b){
9030 return this_t(a)+=b;
9031 }
9032
9033 template<typename U>
9034 this_t&& operator+(U&& b)&&noexcept_as(*this+=b) requires was_not_an_ill_form(*this+=b){//对右值的operator+优化为operator+=
9035 return *this+=b;
9036 }
9037
9038
9039 template<typename U>
9040 [[nodiscard]]iterator find(U&&a)noexcept requires was_not_an_ill_form(in_range(declvalue(this_t),a)){
9041 return in_range(*this,a);
9042 }
9043 template<typename U>
9044 [[nodiscard]]const_iterator find(U&&a)const noexcept requires was_not_an_ill_form(in_range(declvalue(this_t),a)){
9045 return in_range(*this,a);
9046 }
9047 };
9048 template<typename T>
9049 inline void swap(array_t<T>&a,array_t<T>&b)noexcept{a.swap_with(b);}
9050
9051 template<class T>
9052 [[nodiscard]]inline auto size_of_array_like(const array_t<remove_cv<T>>&a)noexcept{return a.size();}
9053 template<class T>
9054 [[nodiscard]]inline auto begin_of_array_like(array_t<remove_cv<T>>&a)noexcept{return(T*)a.begin();}
9055 template<class T>
9056 [[nodiscard]]inline auto begin_of_array_like(const array_t<remove_cv<T>>&a)noexcept{return(const T*)a.begin();}
9057 }
9058
9059 //file_end
9060
9061 #line 9 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/array/_body.hpp"
9062 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/array/deduction_guides.hpp"
9063 //deduction_guides.hpp
9064 //at namespace elc::defs::container
9065 /*
9066 未完成的elc解释器base文件
9067 由steve02081504与Alex0125设计、编写
9068 转载时请在不对此文件做任何修改的同时注明出处
9069 项目地址:https://github.com/steve02081504/ELC
9070 */
9071 namespace array_n{
9072 template <class T,class...U>
9074 template <class T>
9076 }
9077
9078 //file_end
9079
9080 #line 10 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/array/_body.hpp"
9081 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/array/_export.hpp"
9082 //_export.hpp
9083 //at namespace elc::defs::container
9084 /*
9085 未完成的elc解释器base文件
9086 由steve02081504与Alex0125设计、编写
9087 转载时请在不对此文件做任何修改的同时注明出处
9088 项目地址:https://github.com/steve02081504/ELC
9089 */
9090 #define export using array_n::
9091 export array_t;
9092 #undef export
9093
9094 //file_end
9095
9096 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/array/_body.hpp"
9097 #if defined(ELC_TEST_ON)
9098 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/array/_test.hpp"
9099 //_test.hpp
9100 //at namespace elc::defs::container
9101 /*
9102 未完成的elc解释器base文件
9103 由steve02081504与Alex0125设计、编写
9104 转载时请在不对此文件做任何修改的同时注明出处
9105 项目地址:https://github.com/steve02081504/ELC
9106 */
9107 namespace array_n{
9108 //BLOCK:for debug
9109 inline void test(){
9110 ELC_TEST_EVENTNAME("array部分测试");
9111 {
9112 array_t<int>anarray;
9113 stest_accert(anarray.size()==0);
9114 anarray.resize(5);
9115 stest_accert(anarray.size()==5);
9116 anarray[2]=99;
9117 stest_accert(anarray[2]==99);
9118 anarray.resize(3);
9119 stest_accert(anarray[2]==99);
9120 anarray=anarray;
9121 swap(anarray,anarray);
9122 }
9123 check_memory_lack();
9124 }
9125 inline void test_log_out(){
9126 }
9127 inline void test_end(){
9128 }
9129 //BLOCK_END
9130 }
9131
9132 //file_end
9133
9134 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/array/_body.hpp"
9135 #endif
9136
9137 //file_end
9138
9139 #line 9 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/_body.hpp"
9140 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/function/_body.hpp"
9141 //_body.hpp
9142 //at namespace elc::defs::container
9143 /*
9144 未完成的elc解释器base文件
9145 由steve02081504与Alex0125设计、编写
9146 转载时请在不对此文件做任何修改的同时注明出处
9147 项目地址:https://github.com/steve02081504/ELC
9148 */
9149 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/function/base_function_t.hpp"
9150 //base_function_t.hpp
9151 //at namespace elc::defs::container
9152 /*
9153 未完成的elc解释器base文件
9154 由steve02081504与Alex0125设计、编写
9155 转载时请在不对此文件做任何修改的同时注明出处
9156 项目地址:https://github.com/steve02081504/ELC
9157 */
9158 namespace function_n{
9159 template<class T>
9161 template<class Ret_t,class...Args_t>
9162 no_vtable_struct base_func_data_t<Ret_t(Args_t...)>:type_info_t<base_func_data_t<Ret_t(Args_t...)>>::template_name with_common_attribute<abstract_base,ref_able,never_in_array>,build_by_get_only{
9163 typedef base_func_data_t<Ret_t(Args_t...)>this_t;
9164 typedef comn_ptr_t<this_t>ptr_t;
9165
9166 virtual ~base_func_data_t()=default;
9167 virtual Ret_t call(Args_t...)=0;
9168 //for equal:
9169 [[nodiscard]]virtual base_type_info_t get_type_info()const noexcept=0;
9170 [[nodiscard]]virtual const void*get_data_begin()const noexcept=0;
9171 [[nodiscard]]virtual bool equal_with(const void*)const=0;
9172 [[noreturn]] virtual void throw_self_ptr()const=0;
9173 [[noreturn]] virtual void throw_self_ptr()=0;
9174 [[nodiscard]]bool operator==(const this_t&a)const{
9175 return this->get_type_info()==a.get_type_info()&&this->equal_with(a.get_data_begin());
9176 }
9177 template<typename T>
9178 [[nodiscard]]bool operator==(const T&a)const{
9179 return this->get_type_info()==type_info<T>&&this->equal_with(addressof(a));
9180 }
9181 typedef Ret_t(*func_ptr_t)(Args_t...);
9182 virtual func_ptr_t get_func_ptr()const noexcept{return nullptr;}
9183 };
9184
9185 template<class T,class Func_t>
9187 template<class T,class Ret_t,class...Args_t>
9188 struct func_data_t<T,Ret_t(Args_t...)>final:
9189 type_info_t<func_data_t<T,Ret_t(Args_t...)>>::template_name with_common_attribute<instance_struct>,
9190 base_func_data_t<Ret_t(Args_t...)>,function_data_warpper_t<T,Ret_t(Args_t...)>{
9191 static_assert(!::std::is_function_v<T>);
9192 typedef base_func_data_t<Ret_t(Args_t...)>base_t;
9193 typedef func_data_t<T,Ret_t(Args_t...)>this_t;
9194 typedef function_data_warpper_t<T,Ret_t(Args_t...)>data_t;
9196 typedef base_t::func_ptr_t func_ptr_t;
9197
9198 [[nodiscard]]bool is_unique()const noexcept{return get_ref_num((base_t*)this)==1;}
9199
9200 using data_t::data_t;
9201 virtual ~func_data_t()override=default;
9202 [[nodiscard]]virtual base_type_info_t get_type_info()const noexcept override final{return type_info<T>;}
9203 [[nodiscard]]virtual const void*get_data_begin()const noexcept override final{return addressof(data_t::get_data());}
9204 [[noreturn]] virtual void throw_self_ptr()const override final{throw addressof(data_t::get_data());}
9205 [[noreturn]] virtual void throw_self_ptr()override final{throw addressof(data_t::get_data());}
9206 [[nodiscard]]virtual bool equal_with(const void*a)const noexcept(equal.able<T>?equal.nothrow<T>:true)override final{
9207 if constexpr(equal.able<T>)
9208 return data_t::get_data()==*remove_const(reinterpret_cast<const T*>(a));
9209 else
9210 return false;
9211 }
9212 [[nodiscard]]virtual Ret_t call(Args_t...args)noexcept(invoke<T>.nothrow<Args_t...>)override final{
9213 return data_t::operator()(forward<Args_t>(args)...);
9214 }
9215
9216 //func ptr convert
9217 virtual func_ptr_t get_func_ptr()const noexcept override final{
9218 if constexpr(type_info<const T>.can_convert_to<func_ptr_t>)
9219 return static_cast<func_ptr_t>(data_t::get_data());
9220 else
9221 return nullptr;
9222 }
9223 };
9224
9225 template<class T>
9227 template<class Ret_t,class...Args_t>
9228 struct default_func_data_t<Ret_t(Args_t...)>final:base_func_data_t<Ret_t(Args_t...)>,instance_struct<default_func_data_t<Ret_t(Args_t...)>>{
9229 typedef base_func_data_t<Ret_t(Args_t...)>base_t;
9231
9232 virtual ~default_func_data_t()noexcept override final{}
9233 virtual Ret_t call(Args_t...)noexcept_as(Ret_t())override final{return Ret_t();}
9234 [[nodiscard]]virtual base_type_info_t get_type_info()const noexcept override final{return type_info<void>;}
9235 [[nodiscard]]virtual const void*get_data_begin()const noexcept override final{return null_ptr;}//这玩意实际上用不到,艹
9236 [[noreturn]] virtual void throw_self_ptr()const override final{throw(const void*)null_ptr;}
9237 [[noreturn]] virtual void throw_self_ptr()override final{throw(void*)null_ptr;}
9238 [[nodiscard]]virtual bool equal_with(const void*)const noexcept override final{return true;}
9239 };
9240 template<class Ret_t,class...Args_t>
9242
9243 template<class Ret_t,class...Args_t>
9244 [[nodiscard]]constexpr base_func_data_t<Ret_t(Args_t...)>*the_get_null_ptr(const base_func_data_t<Ret_t(Args_t...)>*)noexcept{
9245 return&default_func_data<Ret_t,Args_t...>;
9246 }
9247
9248 template<class T>
9250 template<class Ret_t,class...Args_t>
9251 class function_data_saver_t<Ret_t(Args_t...)>{
9252 protected:
9253 typedef function_data_saver_t<Ret_t(Args_t...)>this_t;
9254 typedef base_func_data_t<Ret_t(Args_t...)> base_t_w;
9255 typedef comn_ptr_t<base_t_w>ptr_t;
9256
9257 mutable ptr_t _m;
9258 void swap_with(this_t&a)noexcept{swap(_m,a._m);}
9259 public:
9260 function_data_saver_t()noexcept=default;
9261 function_data_saver_t(const this_t&a)noexcept:_m(a._m){}
9262 function_data_saver_t(this_t&&a)noexcept{swap_with(a);}
9263 [[nodiscard]]bool operator==(const this_t&a)const{
9264 return *_m==*(a._m);
9265 }
9266 template<typename T> requires(equal.able<base_t_w,T>)
9267 [[nodiscard]]bool operator==(T&&a)const noexcept(equal.nothrow<base_t_w,T>){
9268 return *_m==a;
9269 }
9270 template<typename T>
9271 [[nodiscard]]bool was_an()const noexcept{
9272 try{
9273 _m->throw_self_ptr();
9274 }
9275 catch(const T*p){
9276 return true;
9277 }
9278 catch(const void*){}
9279 return false;
9280 }
9281 template<typename T>
9282 [[nodiscard]]maybe_fail_reference<T> get_as()noexcept{
9283 try{
9284 _m->throw_self_ptr();
9285 }
9286 catch(T*p){
9287 return *p;
9288 }
9289 catch(void*){}
9290 return note::fail;
9291 }
9292 suppress_msvc_warning(26440)//nothrow警告diss
9293 void operator=(const this_t&a){_m=a._m;}
9294 Ret_t call(Args_t&&...rest)const{return _m->call(forward<Args_t>(rest)...);}
9295 };
9296
9297 #if !defined(_MSC_VER)
9298 template<class T,bool promise_nothrow_at_destruct>
9300 template<class Ret_t,class...Args_t,bool nothrow,bool promise_nothrow_at_destruct>
9301 struct base_function_t<Ret_t(Args_t...)noexcept(nothrow),promise_nothrow_at_destruct>:function_data_saver_t<Ret_t(Args_t...)>{
9302 protected:
9303 typedef function_data_saver_t<Ret_t(Args_t...)>base_t;
9304 typedef base_function_t<Ret_t(Args_t...)noexcept(nothrow),promise_nothrow_at_destruct>this_t;
9305
9306 template<class,bool>
9307 friend class base_function_t;
9308
9309 template<class U>
9310 using func_data_t=function_n::func_data_t<U,Ret_t(Args_t...)>;
9311
9312 typedef Ret_t(*func_ptr_t)(Args_t...)noexcept(nothrow);
9313
9314 using base_t::ptr_t;
9315 using base_t::_m;
9316
9317 template<class T>
9318 static constexpr bool base_on_this_t_or_more_stringent_restrictions=(
9319 type_info<T>.base_on<this_t>||
9320 type_info<T>.base_on<base_function_t<Ret_t(Args_t...)noexcept(bool(nothrow+1)), promise_nothrow_at_destruct >>||
9321 type_info<T>.base_on<base_function_t<Ret_t(Args_t...)noexcept(nothrow), bool(promise_nothrow_at_destruct+1) >>||
9322 type_info<T>.base_on<base_function_t<Ret_t(Args_t...)noexcept(bool(nothrow+1)), bool(promise_nothrow_at_destruct+1) >>
9323 );
9324
9325 template<class T>
9326 static constexpr bool get_data_able=invoke<T>.able<Args_t...> && not base_on_this_t_or_more_stringent_restrictions<T>;
9327 template<class T>
9328 static constexpr bool get_data_nothrow=get<func_data_t<remove_cvref<T>>>.nothrow<T>;
9329
9330 template<class T> requires(get_data_able<T> && get<func_data_t<remove_cvref<T>>>.able<T>)
9331 static ptr_t get_data_from(T&&a)noexcept(get_data_nothrow<T>){
9332 //BLOCK:constexpr checks
9333 if constexpr(promise_nothrow_at_destruct and not destruct.nothrow<T>)
9334 template_error("unexpected assign.");
9335 if constexpr(nothrow)
9336 if constexpr(!invoke<T>.nothrow<Args_t...>)
9337 template_warning("the call of T was not noexcept,this may cause terminate.");
9338 //BLOCK_END
9339 return get<func_data_t<remove_cvref<T>>>(a);
9340 }
9341 explicit base_function_t(base_t::ptr_t a)noexcept{_m=a;}
9342 public:
9343 void swap_with(this_t&a)noexcept{//不与base_t::swap_with重复:与更加严格(或宽松)的this_t进行swap是错误的
9344 base_t::swap_with(a);
9345 }
9346
9347 base_function_t()noexcept=default;
9348 template<class T> requires base_on_this_t_or_more_stringent_restrictions<T>
9349 base_function_t(const T&a)noexcept:base_t(a){}
9350 base_function_t(const this_t&a)noexcept:base_t(a){}
9352 swap_with(a);
9353 }
9356 template<class T> requires(get_data_able<T>)
9357 base_function_t(T&&a)noexcept(get_data_nothrow<T>){
9358 _m=get_data_from(forward<T>(a));
9359 }
9360 base_function_t(func_ptr_t a)noexcept{//当nothrow==0时,noexcept(true)的参数可自动转为noexcept(false)的,不用再次考虑
9361 _m=get<func_data_t<func_ptr_t>>(a);
9362 }
9363 ~base_function_t()noexcept(promise_nothrow_at_destruct)=default;
9364
9365 this_t&operator=(const this_t&a)&noexcept(promise_nothrow_at_destruct)=default;
9366 this_t&operator=(this_t&&a)&noexcept(promise_nothrow_at_destruct)=default;
9367 this_t&operator=(null_ptr_t)&noexcept(promise_nothrow_at_destruct){_m=null_ptr;return *this;}
9368 this_t&operator=(nullptr_t)&noexcept(promise_nothrow_at_destruct){return *this=null_ptr;}
9369 template<class T> requires base_on_this_t_or_more_stringent_restrictions<T>
9370 this_t&operator=(const T&a)&noexcept(promise_nothrow_at_destruct){
9371 base_t::operator=(a);
9372 return*this;
9373 }
9374 template<class T> requires(get_data_able<T>)
9375 this_t&operator=(T&&a)noexcept(get_data_nothrow<T> && promise_nothrow_at_destruct){
9376 _m=get_data_from(forward<T>(a));
9377 return*this;
9378 }
9379
9380 this_t deep_copy(){return this_t{copy_get(_m.get())};}
9381
9382 [[nodiscard]]explicit operator bool()const noexcept{
9383 return bool(_m);
9384 }
9385
9386 Ret_t operator()(Args_t...args)const noexcept(nothrow){
9388 return base_t::call(forward<Args_t>(args)...);
9389 }
9390
9391 private:
9392 //以下是突然想加的功能(没什么用<迷惑行为大赏>).
9393 static thread_local inline base_t::base_t_w* _func_ptr_data_local=nullptr;
9394 static inline ::std::atomic<decltype(_func_ptr_data_local)> _func_ptr_data_gobal=nullptr;
9395 static Ret_t _func_ptr_value(Args_t...args)noexcept{
9396 if(!_func_ptr_data_local)
9397 _func_ptr_data_local=_func_ptr_data_gobal.load(::std::memory_order_relaxed);
9398 return _func_ptr_data_local->call(forward<Args_t>(args)...);
9399 }
9400 public:
9401 //自当前function对象生成一个函数指针,具有与当前function对象相同的行为
9402 //注意:该函数指针的有效性保留到当前线程下一个同类型的函数指针生成时或当前function对象析构时
9403 //若自该函数指针创建一个新的线程,该函数指针在新线程中的行为与调用时以前所有线程中最后一个生成的同类型的函数指针行为相同
9404 [[nodiscard]]explicit operator func_ptr_t()const noexcept(promise_nothrow_at_destruct){
9405 func_ptr_t a=(func_ptr_t)_m->get_func_ptr();
9406 if(a)return a;
9407 _func_ptr_data_local=base_t::_m.get();
9408 _func_ptr_data_gobal.store(_func_ptr_data_local,::std::memory_order_relaxed);
9409 return _func_ptr_value;
9410 }
9411 };
9412 #else
9413 //MSVC,我滴垃圾堆
9414 template<class T,bool promise_nothrow_at_destruct>
9415 class base_function_t;
9416 template<class Ret_t,class...Args_t,bool promise_nothrow_at_destruct>
9417 struct base_function_t<Ret_t(Args_t...),promise_nothrow_at_destruct>:function_data_saver_t<Ret_t(Args_t...)>{
9418 protected:
9419 typedef function_data_saver_t<Ret_t(Args_t...)>base_t;
9420 typedef base_function_t<Ret_t(Args_t...),promise_nothrow_at_destruct>this_t;
9421
9422 template<class,bool>
9423 friend class base_function_t;
9424
9425 template<class U>
9426 using func_data_t=function_n::func_data_t<U,Ret_t(Args_t...)>;
9427
9428 typedef Ret_t(*func_ptr_t)(Args_t...);
9429
9430 using base_t::ptr_t;
9431 using base_t::_m;
9432
9433 template<class T>
9434 static constexpr bool base_on_this_t_or_more_stringent_restrictions=(
9435 type_info<T>.base_on<this_t>||
9436 type_info<T>.base_on<base_function_t<Ret_t(Args_t...)noexcept, promise_nothrow_at_destruct >>||
9437 type_info<T>.base_on<base_function_t<Ret_t(Args_t...), bool(promise_nothrow_at_destruct+1) >>||
9438 type_info<T>.base_on<base_function_t<Ret_t(Args_t...)noexcept, bool(promise_nothrow_at_destruct+1) >>
9439 );
9440
9441 template<class T>
9442 static constexpr bool get_data_able=invoke<T>.able<Args_t...> && not base_on_this_t_or_more_stringent_restrictions<T>;
9443 template<class T>
9444 static constexpr bool get_data_nothrow=get<func_data_t<remove_cvref<T>>>.nothrow<T>;
9445
9446 template<class T> requires(get_data_able<T> && get<func_data_t<remove_cvref<T>>>.able<T>)
9447 static auto get_data_from(T&&a)noexcept(get_data_nothrow<T>){
9448 //BLOCK:constexpr checks
9449 if constexpr(promise_nothrow_at_destruct and not destruct.nothrow<T>)
9450 template_error("unexpected assign.");
9451 //BLOCK_END
9452 return get<func_data_t<remove_cvref<T>>>(a);
9453 }
9454 explicit base_function_t(base_t::ptr_t a)noexcept{_m=a;}
9455 public:
9456 void swap_with(this_t&a)noexcept{//不与base_t::swap_with重复:与更加严格(或宽松)的this_t进行swap是错误的
9457 base_t::swap_with(a);
9458 }
9459
9460 base_function_t()noexcept=default;
9461 template<class T> requires base_on_this_t_or_more_stringent_restrictions<T>
9462 base_function_t(const T&a)noexcept:base_t(a){}
9463 base_function_t(const this_t&a)noexcept:base_t(a){}
9464 base_function_t(this_t&&a)noexcept:base_function_t(){
9465 swap_with(a);
9466 }
9467 base_function_t(null_ptr_t)noexcept:base_function_t(){}
9468 base_function_t(nullptr_t)noexcept:base_function_t(null_ptr){}
9469 template<class T> requires(get_data_able<T>)
9470 base_function_t(T&&a)noexcept(get_data_nothrow<T>){
9471 _m=get_data_from(forward<T>(a));
9472 }
9473 base_function_t(func_ptr_t a)noexcept{//当nothrow==0时,noexcept(true)的参数可自动转为noexcept(false)的,不用再次考虑
9474 _m=get<func_data_t<func_ptr_t>>(a);
9475 }
9476 ~base_function_t()noexcept(promise_nothrow_at_destruct)=default;
9477
9478 this_t&operator=(const this_t&a)noexcept(promise_nothrow_at_destruct)=default;
9479 this_t&operator=(this_t&&a)noexcept(promise_nothrow_at_destruct)=default;
9480 this_t&operator=(null_ptr_t)noexcept(promise_nothrow_at_destruct){_m=null_ptr;return *this;}
9481 this_t&operator=(nullptr_t)noexcept(promise_nothrow_at_destruct){return *this=null_ptr;}
9482 template<class T> requires base_on_this_t_or_more_stringent_restrictions<T>
9483 this_t&operator=(const T&a)&noexcept(promise_nothrow_at_destruct){
9484 base_t::operator=(a);
9485 return*this;
9486 }
9487 template<class T> requires(get_data_able<T>)
9488 this_t&operator=(T&&a)noexcept(get_data_nothrow<T> && promise_nothrow_at_destruct){
9489 _m=get_data_from(forward<T>(a));
9490 return*this;
9491 }
9492
9493 this_t deep_copy(){return this_t{copy_get(_m.get())};}
9494
9495 [[nodiscard]]explicit operator bool()const noexcept{
9496 return bool(_m);
9497 }
9498
9499 Ret_t operator()(Args_t...args){
9500 return base_t::call(forward<Args_t>(args)...);
9501 }
9502 Ret_t operator()(Args_t...args)const{
9503 return base_t::call(forward<Args_t>(args)...);
9504 }
9505
9506 private:
9507 //以下是突然想加的功能(没什么用<迷惑行为大赏>).
9508 static thread_local inline base_t::base_t_w* _func_ptr_data_local=nullptr;
9509 static inline ::std::atomic<decltype(_func_ptr_data_local)> _func_ptr_data_gobal=nullptr;
9510 static Ret_t _func_ptr_value(Args_t...args)noexcept{
9511 if(!_func_ptr_data_local)
9512 _func_ptr_data_local=_func_ptr_data_gobal.load(::std::memory_order_relaxed);
9513 return _func_ptr_data_local->call(forward<Args_t>(args)...);
9514 }
9515 public:
9516 //自当前function对象生成一个函数指针,具有与当前function对象相同的行为
9517 //注意:该函数指针的有效性保留到当前线程下一个同类型的函数指针生成时或当前function对象析构时
9518 //若自该函数指针创建一个新的线程,该函数指针在新线程中的行为与调用时以前所有线程中最后一个生成的同类型的函数指针行为相同
9519 [[nodiscard]]explicit operator func_ptr_t()const noexcept(promise_nothrow_at_destruct){
9520 func_ptr_t a=(func_ptr_t)_m->get_func_ptr();
9521 if(a)return a;
9522 _func_ptr_data_local=base_t::_m.get();
9523 _func_ptr_data_gobal.store(_func_ptr_data_local,::std::memory_order_relaxed);
9524 return _func_ptr_value;
9525 }
9526 };
9527 template<class Ret_t,class...Args_t,bool promise_nothrow_at_destruct>
9528 struct base_function_t<Ret_t(Args_t...)noexcept,promise_nothrow_at_destruct>:function_data_saver_t<Ret_t(Args_t...)>{
9529 protected:
9530 typedef function_data_saver_t<Ret_t(Args_t...)>base_t;
9531 typedef base_function_t<Ret_t(Args_t...)noexcept,promise_nothrow_at_destruct>this_t;
9532
9533 template<class,bool>
9534 friend class base_function_t;
9535
9536 template<class U>
9537 using func_data_t=function_n::func_data_t<U,Ret_t(Args_t...)>;
9538
9539 typedef Ret_t(*func_ptr_t)(Args_t...)noexcept;
9540
9541 using base_t::ptr_t;
9542 using base_t::_m;
9543
9544 template<class T>
9545 static constexpr bool base_on_this_t_or_more_stringent_restrictions=(
9546 type_info<T>.base_on<this_t>||
9547 type_info<T>.base_on<base_function_t<Ret_t(Args_t...)noexcept, promise_nothrow_at_destruct >>||
9548 type_info<T>.base_on<base_function_t<Ret_t(Args_t...)noexcept, bool(promise_nothrow_at_destruct+1) >>
9549 );
9550
9551 template<class T>
9552 static constexpr bool get_data_able=invoke<T>.able<Args_t...> && not base_on_this_t_or_more_stringent_restrictions<T>;
9553 template<class T>
9554 static constexpr bool get_data_nothrow=get<func_data_t<remove_cvref<T>>>.nothrow<T>;
9555
9556 template<class T> requires(get_data_able<T> && get<func_data_t<remove_cvref<T>>>.able<T>)
9557 static auto get_data_from(T&&a)noexcept(get_data_nothrow<T>){
9558 //BLOCK:constexpr checks
9559 if constexpr(promise_nothrow_at_destruct and not destruct.nothrow<T>)
9560 template_error("unexpected assign.");
9561 if constexpr(1)
9562 if constexpr(!invoke<T>.nothrow<Args_t...>)
9563 template_warning("the call of T was not noexcept,this may cause terminate.");
9564 //BLOCK_END
9565 return get<func_data_t<remove_cvref<T>>>(a);
9566 }
9567 explicit base_function_t(base_t::ptr_t a)noexcept{_m=a;}
9568 public:
9569 void swap_with(this_t&a)noexcept{//不与base_t::swap_with重复:与更加严格(或宽松)的this_t进行swap是错误的
9570 base_t::swap_with(a);
9571 }
9572
9573 base_function_t()noexcept=default;
9574 template<class T> requires base_on_this_t_or_more_stringent_restrictions<T>
9575 base_function_t(const T&a)noexcept:base_t(a){}
9576 base_function_t(const this_t&a)noexcept:base_t(a){}
9577 base_function_t(this_t&&a)noexcept:base_function_t(){
9578 swap_with(a);
9579 }
9580 base_function_t(null_ptr_t)noexcept:base_function_t(){}
9581 base_function_t(nullptr_t)noexcept:base_function_t(null_ptr){}
9582 template<class T> requires(get_data_able<T>)
9583 base_function_t(T&&a)noexcept(get_data_nothrow<T>){
9584 _m=get_data_from(forward<T>(a));
9585 }
9586 base_function_t(func_ptr_t a)noexcept{//当nothrow==0时,noexcept(true)的参数可自动转为noexcept(false)的,不用再次考虑
9587 _m=get<func_data_t<func_ptr_t>>(a);
9588 }
9589 ~base_function_t()noexcept(promise_nothrow_at_destruct)=default;
9590
9591 this_t&operator=(const this_t&a)&noexcept(promise_nothrow_at_destruct)=default;
9592 this_t&operator=(this_t&&a)&noexcept(promise_nothrow_at_destruct)=default;
9593 this_t&operator=(null_ptr_t)&noexcept(promise_nothrow_at_destruct){_m=null_ptr;return *this;}
9594 this_t&operator=(nullptr_t)&noexcept(promise_nothrow_at_destruct){return *this=null_ptr;}
9595 template<class T> requires base_on_this_t_or_more_stringent_restrictions<T>
9596 this_t&operator=(const T&a)&noexcept(promise_nothrow_at_destruct){
9597 base_t::operator=(a);
9598 return*this;
9599 }
9600 template<class T> requires(get_data_able<T>)
9601 this_t&operator=(T&&a)noexcept(get_data_nothrow<T> && promise_nothrow_at_destruct){
9602 _m=get_data_from(forward<T>(a));
9603 return*this;
9604 }
9605
9606 this_t deep_copy(){return this_t{copy_get(_m.get())};}
9607
9608 [[nodiscard]]explicit operator bool()const noexcept{
9609 return bool(_m);
9610 }
9611
9612 Ret_t operator()(Args_t...args)noexcept{
9614 return base_t::call(forward<Args_t>(args)...);
9615 }
9616 Ret_t operator()(Args_t...args)const noexcept{
9618 return base_t::call(forward<Args_t>(args)...);
9619 }
9620
9621 private:
9622 //以下是突然想加的功能(没什么用<迷惑行为大赏>).
9623 static thread_local inline base_t::base_t_w* _func_ptr_data_local=nullptr;
9624 static inline ::std::atomic<decltype(_func_ptr_data_local)> _func_ptr_data_gobal=nullptr;
9625 static Ret_t _func_ptr_value(Args_t...args)noexcept{
9626 if(!_func_ptr_data_local)
9627 _func_ptr_data_local=_func_ptr_data_gobal.load(::std::memory_order_relaxed);
9628 return _func_ptr_data_local->call(forward<Args_t>(args)...);
9629 }
9630 public:
9631 //自当前function对象生成一个函数指针,具有与当前function对象相同的行为
9632 //注意:该函数指针的有效性保留到当前线程下一个同类型的函数指针生成时或当前function对象析构时
9633 //若自该函数指针创建一个新的线程,该函数指针在新线程中的行为与调用时以前所有线程中最后一个生成的同类型的函数指针行为相同
9634 [[nodiscard]]explicit operator func_ptr_t()const noexcept(promise_nothrow_at_destruct){
9635 func_ptr_t a=(func_ptr_t)_m->get_func_ptr();
9636 if(a)return a;
9637 _func_ptr_data_local=base_t::_m.get();
9638 _func_ptr_data_gobal.store(_func_ptr_data_local,::std::memory_order_relaxed);
9639 return _func_ptr_value;
9640 }
9641 };
9642 #endif
9643 template<class T,bool promise_nothrow_at_destruct>
9645 a.swap_with(b);
9646 }
9647 }
9648
9649 //file_end
9650
9651 #line 9 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/function/_body.hpp"
9652 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/function/defs.hpp"
9653 //defs.hpp
9654 //at namespace elc::defs::container
9655 /*
9656 未完成的elc解释器base文件
9657 由steve02081504与Alex0125设计、编写
9658 转载时请在不对此文件做任何修改的同时注明出处
9659 项目地址:https://github.com/steve02081504/ELC
9660 */
9661 namespace function_n{
9662 template<class T>
9664
9665 //[[deprecated("not safe")]]//用这么长名字的人大概知道自己在干啥
9666 template<class T>
9668 }
9669
9670 //file_end
9671
9672 #line 10 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/function/_body.hpp"
9673 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/function/deduction_guides.hpp"
9674 //deduction_guides.hpp
9675 //at namespace elc::defs::container
9676 /*
9677 未完成的elc解释器base文件
9678 由steve02081504与Alex0125设计、编写
9679 转载时请在不对此文件做任何修改的同时注明出处
9680 项目地址:https://github.com/steve02081504/ELC
9681 */
9682 namespace function_n{
9683 template<typename T,typename Func_t=get_function_type<T>,bool promise_nothrow_at_destruct>
9684 base_function_t(T)->base_function_t<Func_t,promise_nothrow_at_destruct>;
9685 }
9686
9687 //file_end
9688
9689 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/function/_body.hpp"
9690 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/function/_export.hpp"
9691 //_export.hpp
9692 //at namespace elc::defs::container
9693 /*
9694 未完成的elc解释器base文件
9695 由steve02081504与Alex0125设计、编写
9696 转载时请在不对此文件做任何修改的同时注明出处
9697 项目地址:https://github.com/steve02081504/ELC
9698 */
9699 #define export using function_n::
9700 export function_t;
9701 //export may_throw_in_destruct_function_t;
9702 #undef export
9703
9704 //file_end
9705
9706 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/function/_body.hpp"
9707 #if defined(ELC_TEST_ON)
9708 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/function/_test.hpp"
9709 //_test.hpp
9710 //at namespace elc::defs::container
9711 /*
9712 未完成的elc解释器base文件
9713 由steve02081504与Alex0125设计、编写
9714 转载时请在不对此文件做任何修改的同时注明出处
9715 项目地址:https://github.com/steve02081504/ELC
9716 */
9717 namespace function_n{
9718 //BLOCK:for debug
9719 inline void test(){
9720 ELC_TEST_EVENTNAME("function部分测试");
9721 {
9722 int tester=0;
9723 #if !defined(_MSC_VER)
9724 function_t
9725 #else
9726 function_t<void()noexcept>
9727 #endif
9728 a(lambda_with_catch (&tester)()noexcept{ tester=1; });
9729 static_assert(type_info<decltype(a)> == type_info<function_t<void()noexcept>>);
9730 stest_accert(tester==0);
9731 a();
9732 stest_accert(tester==1);
9733 #if !defined(_MSC_VER)
9734 function_t
9735 #else
9736 function_t<void()>
9737 #endif
9738 b=test;
9739 static_assert(type_info<decltype(b)> == type_info<function_t<void()>>);
9740 b=a;
9741 a=null_ptr;
9742 tester=0;
9743 a();
9744 stest_accert(tester==0);
9745 b();
9746 stest_accert(tester==1);
9747 swap(a,a);
9748 stest_accert(a!=b);
9749 b=a;
9750 stest_accert(a==b);
9751 }
9752 check_memory_lack();
9753 }
9754 inline void test_log_out(){
9755 }
9756 inline void test_end(){
9757 }
9758 //BLOCK_END
9759 }
9760
9761 //file_end
9762
9763 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/function/_body.hpp"
9764 #endif
9765
9766 //file_end
9767
9768 #line 10 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/_body.hpp"
9769
9770 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/stacks/_body.hpp"
9771 //_body.hpp
9772 //at namespace elc::defs::container
9773 /*
9774 未完成的elc解释器base文件
9775 由steve02081504与Alex0125设计、编写
9776 转载时请在不对此文件做任何修改的同时注明出处
9777 项目地址:https://github.com/steve02081504/ELC
9778 */
9779 namespace stack_n{
9780 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/stacks/base_stack.hpp"
9781 //defs.hpp
9782 //at namespace elc::defs::container::stack_n
9783 /*
9784 未完成的elc解释器base文件
9785 由steve02081504与Alex0125设计、编写
9786 转载时请在不对此文件做任何修改的同时注明出处
9787 项目地址:https://github.com/steve02081504/ELC
9788 */
9789 template<typename T>
9790 class base_stack_t:non_copyable{//基础容器,可用于hashtable
9791 typedef base_stack_t<T>this_t;
9792 protected:
9793 struct data_t{
9796
9797 constexpr_as(construct<T>(declvalue(const T&)))data_t(const T&a,data_t*b)noexcept(construct<T>.nothrow<const T&>):_data(a),_next(b){}
9798 constexpr_as(construct<T>(declvalue(const T&)))data_t(const data_t&a)noexcept(construct<T>.nothrow<const T&>):_data(a._data),_next(null_ptr){}
9800 size_t _size;
9801 private:
9802 this_t copy()const noexcept(copy_get.nothrow<data_t>){
9803 this_t tmp;
9804 const data_t*p=_m;
9805 data_t**p_=&tmp._m;
9806 while(p!=null_ptr){
9807 *p_=copy_get(p);
9808 p_=&(**p_)._next;
9809 p=p->_next;
9810 }
9811 tmp._size=size();
9812 return tmp;
9813 }
9814 public:
9815 constexpr base_stack_t()noexcept:_m(null_ptr),_size(0){}
9816 void swap_with(this_t&a)noexcept{
9817 swap(_m,a._m);
9818 swap(_size,a._size);
9819 }
9821 swap_with(a);
9822 return*this;
9823 }
9825 operator=(move(a));
9826 }
9828 return operator=(a.copy());
9829 }
9831 ~base_stack_t()noexcept(unget.nothrow<data_t>){
9832 suppress_msvc_warning(26494)//未初始化警告diss
9833 data_t*tmp;
9834 while(_m!=null_ptr){
9835 tmp=_m;
9836 _m=_m->_next;
9837 unget(tmp);
9838 }
9839 }
9840 void clear()noexcept(re_construct.nothrow<this_t>){
9841 re_construct(this);
9842 }
9843 [[nodiscard]]bool empty()const noexcept{
9844 return _m==null_ptr;
9845 }
9846 template<typename U>
9848 data_t*tmp=_m;
9849 while(tmp!=null_ptr){
9850 if(tmp->_data==a)
9851 return tmp->_data;
9852 tmp=tmp->_next;
9853 }
9854 return note::fail;
9855 }
9856 [[nodiscard]]bool in_stack(const T&a)const noexcept_as(declvalue(this_t).find(a).not_fail()){
9857 return remove_const(this)->find(a).not_fail();
9858 }
9859 [[nodiscard]]bool not_in_stack(const T&a)const noexcept_as(declvalue(this_t).in_stack(a)){
9860 return not in_stack(a);
9861 }
9862 [[nodiscard]]size_t size()const noexcept{
9863 return _size;
9864 }
9865
9866 static constexpr bool add_nothrow=noexcept(get<data_t>(declvalue(const T&),declvalue(data_t*)));
9867 void add(const T&a)noexcept(add_nothrow){
9868 _m=get<data_t>(a,_m);
9869 _size++;
9870 }
9871
9872 static constexpr bool remove_nothrow=unget.nothrow<data_t>;
9873 template<typename T_>
9874 bool remove(const T_&a)noexcept(remove_nothrow && equal.nothrow<T_,T>){//返回值:是否成功移除(容器里是否有此T)
9875 data_t*tmp=_m,**tmp_=&_m;
9876 while(tmp!=null_ptr){
9877 if(a==tmp->_data){
9878 _size--;
9879 *tmp_=tmp->_next;
9880 unget(tmp);
9881 return true;
9882 }
9883 tmp_=&tmp->_next;
9884 tmp=*tmp_;
9885 }
9886 return false;
9887 }
9888 #define expr declvalue(func_t)(declvalue(T&))
9889 template<typename func_t> requires was_not_an_ill_form(expr)
9890 void for_each(func_t&&func)noexcept_as(expr){
9891 data_t*tmp=_m;
9892 while(tmp!=null_ptr){
9893 func(tmp->_data);
9894 tmp=tmp->_next;
9895 }
9896 }
9897 #undef expr
9898
9899 #define expr declvalue(func_t)(declvalue(const T&))
9900 template<typename func_t> requires was_not_an_ill_form(expr)
9901 void for_each(func_t&&func)const noexcept_as(expr){
9902 const data_t*tmp=_m;
9903 while(tmp!=null_ptr){
9904 func(tmp->_data);
9905 tmp=tmp->_next;
9906 }
9907 }
9908 #undef expr
9909 protected:
9910 void add(data_t*a)noexcept{
9911 a->_next=_m;
9912 _m=a;
9913 _size++;
9914 }
9915 public:
9917 if(_m)
9918 return hash(_m->_data);
9919 else
9920 return hash(_m);
9921 }
9922 void move_top_to(this_t&a)noexcept{
9923 _size--;
9924 auto tmp=_m;
9925 _m=_m->_next;
9926 a.add(tmp);
9927 }
9928 };
9929
9930 //file_end
9931
9932 #line 10 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/stacks/_body.hpp"
9933 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/stacks/auto_stack.hpp"
9934 //defs.hpp
9935 //at namespace elc::defs::container::stack_n
9936 /*
9937 未完成的elc解释器base文件
9938 由steve02081504与Alex0125设计、编写
9939 转载时请在不对此文件做任何修改的同时注明出处
9940 项目地址:https://github.com/steve02081504/ELC
9941 */
9942 template<typename T>
9943 struct auto_stack_t:base_stack_t<T>{//提头优化容器,可用于hashtable
9944 private:
9945 typedef base_stack_t<T>base_t;
9946 typedef auto_stack_t<T>this_t;
9947
9948 using base_t::data_t;
9949 using base_t::_m;
9950 public:
9951 using base_t::base_t;
9954
9955 this_t&operator=(this_t&&a)&noexcept{base_t::operator=(move(a));return*this;}
9956 template<typename U>
9958 data_t*tmp=_m,**tmp_=&_m;
9959 while(tmp!=null_ptr){
9960 if(tmp->_data==a){
9961 *tmp_=tmp->_next;
9962 tmp->_next=_m;//提头
9963 _m=tmp;
9964 return tmp->_data;
9965 }
9966 tmp_=&tmp->_next;
9967 tmp=*tmp_;
9968 }
9969 return note::fail;
9970 }
9971 [[nodiscard]]bool in_stack(const T&a)const noexcept_as(declvalue(this_t).find(a).not_fail()){
9972 return remove_const(this)->find(a).not_fail();
9973 }
9974 [[nodiscard]]bool not_in_stack(const T&a)const noexcept_as(declvalue(this_t).in_stack(a)){
9975 return not in_stack(a);
9976 }
9977 };
9978
9979 //file_end
9980
9981 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/stacks/_body.hpp"
9982
9983 #if defined(ELC_TEST_ON)
9984 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/stacks/_test.hpp"
9985 //_test.hpp
9986 //at namespace elc::defs::container::stack_n
9987 /*
9988 未完成的elc解释器base文件
9989 由steve02081504与Alex0125设计、编写
9990 转载时请在不对此文件做任何修改的同时注明出处
9991 项目地址:https://github.com/steve02081504/ELC
9992 */
9993 inline void test(){
9994 ELC_TEST_EVENTNAME("stack部分测试");
9995 {
9996 base_stack_t<int>a;
9997 stest_accert(a.size()==0);
9998 a.add(1);
9999 a.add(2);
10000 a.add(3);
10001 stest_accert(a.size()==3);
10002 a.remove(2);
10003 stest_accert(a.size()==2);
10004 int add_num=0;
10005 a.for_each(lambda_with_catch(&add_num)(int a){add_num+=a;});
10006 stest_accert(add_num==4);
10007 auto_stack_t<int>b=a;
10008 stest_accert(b.not_in_stack(2));
10009 b.remove(3);
10010 stest_accert(a.in_stack(3));
10011 a.clear();
10012 b=a;
10013 a=b;
10014 stest_accert(b.size()==0);
10015 }
10016 check_memory_lack();
10017 }
10018 inline void test_log_out(){
10019 }
10020 inline void test_end(){
10021 }
10022
10023 //file_end
10024
10025 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/stacks/_body.hpp"
10026 #endif
10027 }
10028 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/stacks/_export.hpp"
10029 //_export.hpp
10030 //at namespace elc::defs::container
10031 /*
10032 未完成的elc解释器base文件
10033 由steve02081504与Alex0125设计、编写
10034 转载时请在不对此文件做任何修改的同时注明出处
10035 项目地址:https://github.com/steve02081504/ELC
10036 */
10037 #define export using stack_n::
10038 export auto_stack_t;
10039 export base_stack_t;
10040 #undef export
10041
10042 //file_end
10043
10044 #line 17 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/stacks/_body.hpp"
10045
10046 //file_end
10047
10048 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/_body.hpp"
10049 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/hash_table/_body.hpp"
10050 //_body.hpp
10051 //at namespace elc::defs::container
10052 /*
10053 未完成的elc解释器base文件
10054 由steve02081504与Alex0125设计、编写
10055 转载时请在不对此文件做任何修改的同时注明出处
10056 项目地址:https://github.com/steve02081504/ELC
10057 */
10058 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/hash_table/defs.hpp"
10059 //defs.hpp
10060 //at namespace elc::defs::container
10061 /*
10062 未完成的elc解释器base文件
10063 由steve02081504与Alex0125设计、编写
10064 转载时请在不对此文件做任何修改的同时注明出处
10065 项目地址:https://github.com/steve02081504/ELC
10066 */
10067 namespace hash_table_n{
10068 template<typename T,template<typename>class stack_t=auto_stack_t,size_t bucket_max_size=256>
10071 typedef stack_t<T>bucket_t;
10072 public:
10073 typedef array_t<bucket_t>base_t_w;
10074 private:
10075 base_t_w _m;
10076 public:
10077 void swap(base_t_w&a)noexcept{_m.swap_with(a);}
10078 private:
10079 [[nodiscard]]bucket_t&find_bucket(hash_t a)noexcept{
10080 return _m[a%_m.size()];
10081 }
10082 void bucket_count_grow()noexcept{
10083 this_t tmp(special_init,get_next_gold_size_to_resize_for_hash(_m.size()));
10084 for(bucket_t&a:_m){
10085 while(!a.empty())
10086 a.move_top_to(tmp.find_bucket(a.get_top_hash()));
10087 }
10088 swap(tmp);
10089 }
10090 hash_table_t(const base_t_w&a)noexcept:_m(a){}
10091 this_t copy()noexcept(copy_construct.nothrow<base_t_w>){
10092 return{_m};
10093 }
10094 public:
10095 hash_table_t()noexcept:_m(5){}
10096 hash_table_t(special_init_t,size_t bucket_size)noexcept:_m(bucket_size){}
10097 ~hash_table_t()noexcept(destruct.nothrow<base_t_w>)=default;
10098
10099 operator base_t_w&()noexcept{return _m;}
10100 operator const base_t_w&()const noexcept{return _m;}
10101
10102 hash_table_t(const this_t&a)noexcept:_m(a._m){}
10103 hash_table_t(this_t&&a)noexcept:_m(a._m){}
10104
10106 swap(_m,a);
10107 return*this;
10108 }
10109 this_t&operator=(const base_t_w&a)&noexcept{
10110 _m=a;
10111 return*this;
10112 }
10113
10114 template<typename U>
10115 static constexpr bool hash_nothrow=noexcept(hash(declvalue(U)));
10116 template<typename U>
10117 static constexpr bool find_nothrow=hash_nothrow<U>&&noexcept(declvalue(bucket_t).find(declvalue(U)));
10118
10119 void add(const T&a)noexcept(hash_nothrow<const T&>&&bucket_t::add_nothrow){
10120 auto&bucket=find_bucket(hash(a));
10121 bucket.add(a);
10122 if(bucket.size() > bucket_max_size)
10123 bucket_count_grow();
10124 }
10125 bool remove(const T&a)noexcept(bucket_t::remove_nothrow){
10126 auto&bucket=find_bucket(hash(a));
10127 bool remove_success=bucket.remove(a);
10128 if constexpr(is_unstable_hash<T>)
10129 if(not remove_success){
10130 for(auto&i:_m){
10131 if(is_eq(i,bucket))
10132 continue;
10133 remove_success=i.remove(a);
10134 if(remove_success)
10135 break;
10136 }
10137 }
10138 return remove_success;
10139 }
10140 template<typename U>
10141 [[nodiscard]]maybe_fail_reference<T>find(U&&a)noexcept(find_nothrow<U>){
10142 auto&bucket=find_bucket(hash(a));
10143 suppress_msvc_warning(26496)//?
10144 auto reference=bucket.find(a);
10145 if constexpr(is_unstable_hash<T>)
10146 if(reference.fail()){
10147 for(auto&i:_m){
10148 if(is_eq(i,bucket))
10149 continue;
10150 re_construct[&reference](i.find(a));
10151 if(reference.not_fail())
10152 break;
10153 }
10154 }
10155 return reference;
10156 }
10157 [[nodiscard]]bool in_table(const T&a)noexcept_as(declvalue(this_t).find(a).not_fail()){
10158 return find(a).not_fail();
10159 }
10160 [[nodiscard]]bool not_in_table(const T&a)noexcept_as(declvalue(this_t).in_table(a)){
10161 return not in_table(a);
10162 }
10163
10164 size_t size()noexcept{
10165 size_t aret=0;
10166 for(const bucket_t&a:_m){
10167 aret+=a.size();
10168 }
10169 return aret;
10170 }
10171
10172 void clear()noexcept(re_construct.nothrow<this_t>){
10173 re_construct(this);
10174 }
10175
10176 #define expr declvalue(func_t)(declvalue(T&))
10177 template<typename func_t> requires was_not_an_ill_form(expr)
10178 void for_each(func_t&&func)noexcept_as(expr){
10179 for(bucket_t&a:_m){
10180 a.for_each(func);
10181 }
10182 }
10183 #undef expr
10184
10185 #define expr declvalue(func_t)(declvalue(const T&))
10186 template<typename func_t> requires was_not_an_ill_form(expr)
10187 void for_each(func_t&&func)const noexcept_as(expr){
10188 for(bucket_t&a:_m){
10189 a.for_each(func);
10190 }
10191 }
10192 #undef expr
10193
10194 #define expr declvalue(func_t)(declvalue(bucket_t&))
10195 template<typename func_t> requires was_not_an_ill_form(expr)
10196 void for_each_bucket(func_t&&func)noexcept_as(expr){
10197 _m.for_each(func);
10198 }
10199 #undef expr
10200
10201 #define expr declvalue(func_t)(declvalue(const bucket_t&))
10202 template<typename func_t> requires was_not_an_ill_form(expr)
10203 void for_each_bucket(func_t&&func)const noexcept_as(expr){
10204 _m.for_each(func);
10205 }
10206 #undef expr
10207 };
10208 template<typename T,template<typename>class stack_t,size_t _,size_t __>
10209 inline void swap(hash_table_t<T,stack_t,_>&a,hash_table_t<T,stack_t,__>&b)noexcept{a.swap(b);}
10210 template<typename T,template<typename>class stack_t,size_t _>
10211 inline void swap(hash_table_t<T,stack_t,_>&a,typename hash_table_t<T,stack_t,_>::base_t_w&b)noexcept{a.swap(b);}
10212 template<typename T,template<typename>class stack_t,size_t _>
10213 inline void swap(typename hash_table_t<T,stack_t,_>::base_t_w&b,hash_table_t<T,stack_t,_>&a)noexcept{a.swap(b);}
10214 }
10215
10216 //file_end
10217
10218 #line 9 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/hash_table/_body.hpp"
10219 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/hash_table/_export.hpp"
10220 //_export.hpp
10221 //at namespace elc::defs::container
10222 /*
10223 未完成的elc解释器base文件
10224 由steve02081504与Alex0125设计、编写
10225 转载时请在不对此文件做任何修改的同时注明出处
10226 项目地址:https://github.com/steve02081504/ELC
10227 */
10228 #define export using hash_table_n::
10229 export hash_table_t;
10230 #undef export
10231
10232 //file_end
10233
10234 #line 10 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/hash_table/_body.hpp"
10235 #if defined(ELC_TEST_ON)
10236 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/hash_table/_test.hpp"
10237 //_test.hpp
10238 //at namespace elc::defs::container
10239 /*
10240 未完成的elc解释器base文件
10241 由steve02081504与Alex0125设计、编写
10242 转载时请在不对此文件做任何修改的同时注明出处
10243 项目地址:https://github.com/steve02081504/ELC
10244 */
10245 namespace hash_table_n{
10246 //BLOCK:for debug
10247 inline void test(){
10248 ELC_TEST_EVENTNAME("hash_table部分测试");
10249 {
10250
10251 }
10252 check_memory_lack();
10253 }
10254 inline void test_log_out(){
10255 }
10256 inline void test_end(){
10257 }
10258 //BLOCK_END
10259 }
10260
10261 //file_end
10262
10263 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/hash_table/_body.hpp"
10264 #endif
10265
10266 //file_end
10267
10268 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/_body.hpp"
10269
10270 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/map/_body.hpp"
10271 //_body.hpp
10272 //at namespace elc::defs::container
10273 /*
10274 未完成的elc解释器base文件
10275 由steve02081504与Alex0125设计、编写
10276 转载时请在不对此文件做任何修改的同时注明出处
10277 项目地址:https://github.com/steve02081504/ELC
10278 */
10279 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/map/defs.hpp"
10280 //defs.hpp
10281 //at namespace elc::defs::container
10282 /*
10283 未完成的elc解释器base文件
10284 由steve02081504与Alex0125设计、编写
10285 转载时请在不对此文件做任何修改的同时注明出处
10286 项目地址:https://github.com/steve02081504/ELC
10287 */
10288 namespace map_n{
10289 template<typename T,typename key_t,template<typename>class stack_t=auto_stack_t,size_t bucket_max_size=256>
10290 class map_t{
10292
10293 struct data_t{
10294 key_t _key;
10295 T _value;
10296
10297 data_t(const data_t&) = default;
10298 data_t(const key_t&a,const T&b)noexcept(copy_construct.nothrow<key_t> && copy_construct.nothrow<T>):_key(a),_value(b){}
10299
10301 const T*_m;
10302 constexpr seek_value_t(const T&a):_m(addressof(a)){};
10303 [[nodiscard]]bool operator==(const data_t&a)const noexcept_as(a._value==*_m){
10304 return bool(a._value==*_m);
10305 }
10306 };
10307
10308 [[nodiscard]]bool operator==(const key_t&a)noexcept_as(_key==a){
10309 return bool(_key==a);
10310 }
10311 [[nodiscard]]constexpr_as(hash(_key))operator decltype(hash(_key))()const noexcept_as(hash(_key)){
10312 return hash(_key);
10313 }
10314 /* operator T&()noexcept{
10315 return _value;
10316 } */
10317 [[nodiscard]]bool empty(){
10318 return _value==const_default_value_of<T>;
10319 }
10320 };
10321 typedef hash_table_t<data_t,stack_t,bucket_max_size>base_t_w;
10322
10323 mutable base_t_w _m;//mutable cause shrink.
10324
10325 map_t(const base_t_w&a)noexcept:_m(a){}
10326 this_t copy()noexcept(copy_construct.nothrow<base_t_w>){
10327 return{_m};//不用疑惑,这是deep copy
10328 }
10329 public:
10330 map_t()noexcept=default;
10331 ~map_t()noexcept(destruct.nothrow<base_t_w>)=default;
10332 map_t(const this_t&a)noexcept=default;
10333 map_t(this_t&&a)noexcept=default;
10334
10335 this_t&operator=(this_t&&a)noexcept{
10336 swap(_m,a._m);
10337 return*this;
10338 }
10339 this_t&operator=(const this_t&a)noexcept{
10340 return operator=(a.copy());
10341 }
10342
10343 template<size_t _>
10344 void swap(map_t<T,key_t,stack_t,_>&a)noexcept{swap(_m,a._m);}
10345
10346 [[nodiscard]]T&operator[](const key_t&a)noexcept_as(_m.add({a,T()})){
10347 auto tmp=_m.find(a);
10348 if(tmp.fail()){
10349 _m.add({a,T()});
10350 tmp=_m.find(a);
10351 }
10352 return tmp.get_ref()._value;
10353 }
10354 [[nodiscard]]const T&operator[](const key_t&a)const noexcept{
10355 auto tmp=_m.find(a);
10356 return tmp.fail()?const_default_value_of<T>:tmp.get_ref()._value;
10357 }
10358 void clear()noexcept(re_construct.nothrow<this_t>){
10359 re_construct(this);
10360 }
10361
10362 #define expr declvalue(func_t)(declvalue(T&))
10363 template<typename func_t> requires was_not_an_ill_form(expr)
10364 void for_each(func_t&&func)noexcept_as(expr){
10365 _m.for_each(lambda(data_t&a)noexcept_as(expr){
10366 func(a._value);
10367 });
10368 }
10369 #undef expr
10370
10371 #define expr declvalue(func_t)(declvalue(const T&))
10372 template<typename func_t> requires was_not_an_ill_form(expr)
10373 void for_each(func_t&&func)const noexcept_as(expr){
10374 _m.for_each(lambda(data_t&a)noexcept_as(expr){
10375 func(add_const<T&>(a._value));
10376 });
10377 }
10378 #undef expr
10379
10380 static constexpr bool shrink_nothow=stack_t<data_t>::remove_nothrow;
10381 void shrink()const noexcept(shrink_nothow){
10382 _m.for_each_bucket(lambda(stack_t<data_t>&a)noexcept(shrink_nothow && equal.nothrow<T>){
10383 while(a.remove(data_t::seek_value_t(const_default_value_of<T>)));
10384 });
10385 }
10386
10388
10389 bool operator==(const this_t&a)const noexcept(shrink_nothow && equal.nothrow<T>){
10390 shrink();
10391 a.shrink();
10392 if(size()!=a.size())
10393 return 0;
10394 try{
10395 _m.for_each(lambda_with_catch(&a)(data_t&b){
10396 if(a[b._key]!=b._value)
10397 throw (this_t*)(nullptr);
10398 });
10399 }
10400 catch(this_t*){
10401 return 0;
10402 }
10403 return 1;
10404 }
10405 };
10406 template<typename T,typename key_t,template<typename>class stack_t,size_t _,size_t __>
10407 inline void swap(map_t<T,key_t,stack_t,_>&a,map_t<T,key_t,stack_t,__>&b)noexcept{a.swap(b);}
10408 }
10409
10410 //file_end
10411
10412 #line 9 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/map/_body.hpp"
10413 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/map/_export.hpp"
10414 //_export.hpp
10415 //at namespace elc::defs::container
10416 /*
10417 未完成的elc解释器base文件
10418 由steve02081504与Alex0125设计、编写
10419 转载时请在不对此文件做任何修改的同时注明出处
10420 项目地址:https://github.com/steve02081504/ELC
10421 */
10422 #define export using map_n::
10423 export map_t;
10424 #undef export
10425
10426 //file_end
10427
10428 #line 10 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/map/_body.hpp"
10429 #if defined(ELC_TEST_ON)
10430 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/map/_test.hpp"
10431 //_test.hpp
10432 //at namespace elc::defs::container
10433 /*
10434 未完成的elc解释器base文件
10435 由steve02081504与Alex0125设计、编写
10436 转载时请在不对此文件做任何修改的同时注明出处
10437 项目地址:https://github.com/steve02081504/ELC
10438 */
10439 namespace map_n{
10440 //BLOCK:for debug
10441 inline void test(){
10442 ELC_TEST_EVENTNAME("map部分测试");
10443 {
10444
10445 }
10446 check_memory_lack();
10447 }
10448 inline void test_log_out(){
10449 }
10450 inline void test_end(){
10451 }
10452 //BLOCK_END
10453 }
10454
10455 //file_end
10456
10457 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/map/_body.hpp"
10458 #endif
10459
10460 //file_end
10461
10462 #line 15 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/_body.hpp"
10463
10464 #if defined(ELC_TEST_ON)
10465 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/_test.hpp"
10466 //_test.hpp
10467 //at namespace elc::defs::container
10468 /*
10469 未完成的elc解释器base文件
10470 由steve02081504与Alex0125设计、编写
10471 转载时请在不对此文件做任何修改的同时注明出处
10472 项目地址:https://github.com/steve02081504/ELC
10473 */
10474 inline void test(){
10475 ELC_TEST_EVENTNAME("container部分测试");
10476 array_n::test();
10477 function_n::test();
10478 stack_n::test();
10479 }
10480 inline void test_log_out(){
10481 array_n::test_log_out();
10482 function_n::test_log_out();
10483 stack_n::test_log_out();
10484 }
10485 inline void test_end(){
10486 array_n::test_end();
10487 function_n::test_end();
10488 stack_n::test_end();
10489 }
10490
10491 //file_end
10492
10493 #line 18 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/_body.hpp"
10494 #endif
10495
10496 //file_end
10497
10498 #line 35 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/_body.hpp"
10499 }
10500 using namespace container;
10501
10502 namespace memory::gc_n{//gc定义,依赖container(但container依赖memory的其他部分)
10503 //依赖container
10504 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/_body.hpp"
10505 //_body.hpp
10506 //at namespace elc::defs::memory::gc_n
10507 /*
10508 未完成的elc解释器base文件
10509 由steve02081504与Alex0125设计、编写
10510 转载时请在不对此文件做任何修改的同时注明出处
10511 项目地址:https://github.com/steve02081504/ELC
10512 */
10513 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/gc_flags/_body.hpp"
10514 //_body.hpp
10515 //at namespace elc::defs::memory::gc_n
10516 /*
10517 未完成的elc解释器base文件
10518 由steve02081504与Alex0125设计、编写
10519 转载时请在不对此文件做任何修改的同时注明出处
10520 项目地址:https://github.com/steve02081504/ELC
10521 */
10522 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/gc_flags/roots/_body.hpp"
10523 //_body.hpp
10524 //at namespace elc::defs::memory::gc_n
10525 /*
10526 未完成的elc解释器base文件
10527 由steve02081504与Alex0125设计、编写
10528 转载时请在不对此文件做任何修改的同时注明出处
10529 项目地址:https://github.com/steve02081504/ELC
10530 */
10531 struct have_root{};
10532
10533 template<typename T>
10534 class root_of;
10535
10536 template<typename T>
10537 class roots_t{
10538 typedef roots_t<T>this_t;
10539 typedef root_of<T>root_t;
10540 typedef root_of<T>*value_t;
10541
10542 base_stack_t<value_t>_roots;
10543 public:
10544 constexpr roots_t()noexcept=default;
10545 ~roots_t()noexcept=default;
10546
10550 using_method_from_value(for_each,_roots);
10551
10552 void map_and_mark()noexcept_as(declvalue(value_t)->map_and_mark()){
10553 _roots.for_each(
10555 {
10556 a->map_and_mark();
10557 }
10558 );
10559 }
10560 };
10561 template<typename T>
10563
10564 template<typename T>
10565 class root_of{
10566 typedef root_of<T>this_t;
10567 public:
10568 root_of()noexcept_as(roots_of<T>.add(declvalue(this_t*))){
10569 roots_of<T>.add(this);
10570 }
10571 virtual T& get()noexcept=0;
10572 virtual void map_and_mark()noexcept=0;
10573 };
10574 template<typename T>
10575 inline T& root_of<T>::get()noexcept{return const_default_value_of<T>;}
10576 template<typename T>
10577 inline void root_of<T>::map_and_mark()noexcept{}
10578
10579 //file_end
10580
10581 #line 9 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/gc_flags/_body.hpp"
10582 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/gc_flags/mark_able_for_gc/_body.hpp"
10583 //_body.hpp
10584 //at namespace elc::defs::memory::gc_n
10585 /*
10586 未完成的elc解释器base文件
10587 由steve02081504与Alex0125设计、编写
10588 转载时请在不对此文件做任何修改的同时注明出处
10589 项目地址:https://github.com/steve02081504/ELC
10590 */
10591 template<typename T>
10593 mark_able_for_gc()noexcept:mark_able<T>(not_mark){}
10595 };
10596
10597 //file_end
10598
10599 #line 10 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/gc_flags/_body.hpp"
10600 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/gc_flags/others/_body.hpp"
10601 //_body.hpp
10602 //at namespace elc::defs::memory::gc_n
10603 /*
10604 未完成的elc解释器base文件
10605 由steve02081504与Alex0125设计、编写
10606 转载时请在不对此文件做任何修改的同时注明出处
10607 项目地址:https://github.com/steve02081504/ELC
10608 */
10611
10612 //file_end
10613
10614 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/gc_flags/_body.hpp"
10615
10616 //file_end
10617
10618 #line 9 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/_body.hpp"
10619
10620 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/gc_t/_body.hpp"
10621 //_body.hpp
10622 //at namespace elc::defs::memory::gc_n
10623 /*
10624 未完成的elc解释器base文件
10625 由steve02081504与Alex0125设计、编写
10626 转载时请在不对此文件做任何修改的同时注明出处
10627 项目地址:https://github.com/steve02081504/ELC
10628 */
10629 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/gc_t/default_method/decl.hpp"
10630 //_body.hpp
10631 //at namespace elc::defs::memory::gc_n
10632 /*
10633 未完成的elc解释器base文件
10634 由steve02081504与Alex0125设计、编写
10635 转载时请在不对此文件做任何修改的同时注明出处
10636 项目地址:https://github.com/steve02081504/ELC
10637 */
10638 template<class T,enable_flag>
10639 inline void gc_method_of()noexcept;
10640 template<class T,enable_flag>
10641 [[nodiscard]]inline bool gc_success_identifier_of()noexcept;
10642
10643 //file_end
10644
10645 #line 9 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/gc_t/_body.hpp"
10646 //
10647 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/gc_t/defs.hpp"
10648 //defs.hpp
10649 //at namespace elc::defs::memory
10650 /*
10651 未完成的elc解释器base文件
10652 由steve02081504与Alex0125设计、编写
10653 转载时请在不对此文件做任何修改的同时注明出处
10654 项目地址:https://github.com/steve02081504/ELC
10655 */
10656 class gc_t{
10657 typedef gc_t this_t;
10658 typedef function_t<void()noexcept>gc_method_t;
10659 typedef function_t<bool()noexcept>success_identifier_t;
10660
10661 base_stack_t<gc_method_t>_gc_methods;
10662 base_stack_t<success_identifier_t>_gc_success_identifiers;
10663 mutable flag _gc_running=flag(not_set);
10664 public:
10665 inline void operator()()const noexcept{
10666 if(_gc_running)
10667 die_with(locale::str::gc_fail);
10668 _gc_running.set();
10669 if(_gc_methods.empty())
10670 die_with(locale::str::empty_gc_method);
10671 _gc_methods.for_each(invoke<const gc_method_t>._as(nothing));
10672 _gc_running.unset();
10673 }
10674 [[nodiscard]]inline bool success()const noexcept{
10675 bool success=_gc_success_identifiers.empty();
10676 _gc_success_identifiers.for_each(
10677 lambda_with_catch(&success)(const success_identifier_t&a)noexcept{
10678 if(not success)
10679 success=a();
10680 }
10681 );
10682 return success;
10683 }
10684
10685 inline void add_gc_method(gc_method_t a)noexcept{
10686 _gc_methods.add(a);
10687 }
10688 inline void remove_gc_method(gc_method_t a){
10689 _gc_methods.remove(a);
10690 }
10691
10692 inline void add_gc_success_identifier(success_identifier_t a)noexcept{
10693 _gc_success_identifiers.add(a);
10694 }
10695 inline void remove_gc_success_identifier(success_identifier_t a){
10696 _gc_success_identifiers.remove(a);
10697 }
10698
10699 template<class T>
10700 inline void add_gc_method(type_info_t<T>)noexcept{
10701 add_gc_method((void(*)()noexcept)gc_method_of<T>);
10702 add_gc_success_identifier(gc_success_identifier_of<T>);
10703 }
10704 template<class T>
10705 inline void remove_gc_method(type_info_t<T>)noexcept{
10706 remove_gc_method(gc_method_of<T>);
10707 remove_gc_success_identifier(gc_success_identifier_of<T>);
10708 }
10709 };
10710
10711 //file_end
10712
10713 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/gc_t/_body.hpp"
10714 //
10715 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/gc_t/default_method/defs.hpp"
10716 //_body.hpp
10717 //at namespace elc::defs::memory::gc_n
10718 /*
10719 未完成的elc解释器base文件
10720 由steve02081504与Alex0125设计、编写
10721 转载时请在不对此文件做任何修改的同时注明出处
10722 项目地址:https://github.com/steve02081504/ELC
10723 */
10724 namespace default_gc_for_type{
10725 template<class T,enable_if(type_info<T>.has_attribute(count_able))>
10727
10728 template<class T>
10729 constexpr bool use_default_gc_able =
10730 (
10731 type_info<T>.has_attribute(mark_able_for_gc) &&
10732 type_info<T>.has_attribute(have_root)
10733 )&&(
10734 type_info<T>.has_attribute(can_map_all)
10735 &&(
10736 type_info<T>.has_attribute(can_shrink)
10737 ||(
10738 type_info<T>.has_attribute(mark_able_for_gc) &&
10739 type_info<T>.has_attribute(have_root)
10740 )
10741 )
10742 );
10743
10744 enable_adl(destory_by_gc);
10745 template<class T>
10747 template_error("this function should not be instantiated,please overload the function destory_by_gc in the namespace where this type is defined.");
10748 }
10749
10750 template<class T> requires use_default_gc_able<T>
10751 inline void default_gc_method()noexcept{
10752 constexpr auto&info=type_info<T>;
10753 //
10754 if constexpr(info.has_attribute(count_able))
10755 count_for_success_identify<T> = the_number_of(info);
10756 //
10757 if constexpr(info.has_attribute(can_map_all)){
10758 if constexpr(info.has_attribute(mark_able_for_gc)&&info.has_attribute(have_root))
10759 roots_of<T>.map_and_mark();
10760 if constexpr(info.has_attribute(can_shrink) || (info.has_attribute(mark_able_for_gc)&&info.has_attribute(have_root)))
10761 map_all<T>(
10762 lambda(T*a)noexcept{
10763 if constexpr(info.has_attribute(can_shrink))
10764 a->shrink();
10765 if constexpr(info.has_attribute(mark_able_for_gc)&&info.has_attribute(have_root)){
10766 auto& b=attribute_cast<mark_able_for_gc>(*a);
10767 if(b.was_marked())
10768 b.unmark();
10769 else
10770 destory_by_gc(a);
10771 }
10772 }
10773 );
10774 }
10775 }
10776 //
10777 template<class T>
10778 constexpr bool use_default_gc_success_identifier_able = type_info<T>.has_attribute(count_able);
10779
10780 template<class T> requires use_default_gc_success_identifier_able<T>
10781 [[nodiscard]]inline bool default_gc_success_identifier()noexcept{
10782 constexpr auto&info=type_info<T>;
10783 if constexpr(info.has_attribute(count_able)){//重复判定,勿删,方便日后扩展
10784 return count_for_success_identify<T> _big_than_ the_number_of(info);
10785 }
10786 }
10787 }
10788 template<class T,enable_if(default_gc_for_type::use_default_gc_able<T>)>
10789 inline void gc_method_of()noexcept{
10790 default_gc_for_type::default_gc_method<T>();
10791 }
10792 template<class T,enable_if(default_gc_for_type::use_default_gc_success_identifier_able<T>)>
10793 [[nodiscard]]inline bool gc_success_identifier_of()noexcept{
10794 return default_gc_for_type::default_gc_success_identifier<T>();
10795 }
10796
10797 //file_end
10798
10799 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/gc_t/_body.hpp"
10800
10801 //file_end
10802
10803 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/_body.hpp"
10804
10805 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/defs.hpp"
10806 //defs.hpp
10807 //at namespace elc::defs::memory::gc_n
10808 /*
10809 未完成的elc解释器base文件
10810 由steve02081504与Alex0125设计、编写
10811 转载时请在不对此文件做任何修改的同时注明出处
10812 项目地址:https://github.com/steve02081504/ELC
10813 */
10815
10816 //file_end
10817
10818 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/_body.hpp"
10819
10820 //for alloc (def in "../alloc/defs.hpp#L10" )
10821 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/gc_for_alloc/_body.hpp"
10822 //_body.hpp
10823 //at namespace elc::defs::memory::gc_n
10824 /*
10825 未完成的elc解释器base文件
10826 由steve02081504与Alex0125设计、编写
10827 转载时请在不对此文件做任何修改的同时注明出处
10828 项目地址:https://github.com/steve02081504/ELC
10829 */
10830 inline void gc_for_alloc()noexcept{
10831 gc();
10832 }
10833
10834 //file_end
10835
10836 #line 15 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/_body.hpp"
10837 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/root_ptr/_body.hpp"
10838 //_body.hpp
10839 //at namespace elc::defs::memory::gc_n
10840 /*
10841 未完成的elc解释器base文件
10842 由steve02081504与Alex0125设计、编写
10843 转载时请在不对此文件做任何修改的同时注明出处
10844 项目地址:https://github.com/steve02081504/ELC
10845 */
10846 BREAK_NAMESPACE//in namespace elc::defs
10847 INTER_NAMESPACE(memory::ptr_n)
10848
10849 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/root_ptr/defs.hpp"
10850 //defs.hpp
10851 //at namespace elc::defs::memory::ptr_n
10852 /*
10853 未完成的elc解释器base文件
10854 由steve02081504与Alex0125设计、编写
10855 转载时请在不对此文件做任何修改的同时注明出处
10856 项目地址:https://github.com/steve02081504/ELC
10857 */
10858 enable_adl(map_and_mark_for_gc);
10859 template<typename T>
10860 void map_and_mark_for_gc(T*)noexcept{
10861 template_error("this function should not be instantiated,please overload the function map_and_mark_for_gc in the namespace where this type is defined");
10862 }
10863 using ::elc::defs::memory::gc_n::root_of;
10864 template<class T,enable_if(
10865 was_ref_able<T> &&
10866 comn_ptr_t<T>::replace_check_nothrow &&
10867 type_info<T>.has_attribute(gc_n::have_root)
10868 )>
10869 struct root_ptr_t:comn_ptr_t<T>,root_of<T>{
10872 public:
10873 using base_t::base_t;
10874 template<class assign_t> requires was_not_an_ill_form(declvalue(base_t)=declvalue(assign_t))
10875 this_t&operator=(assign_t&&a)noexcept_as(base_t::operator=(forward<assign_t>(a))){
10876 base_t::operator=(forward<assign_t>(a));
10877 return*this;
10878 }
10879 virtual T& get()noexcept override{
10880 return base_t::operator*();
10881 }
10882 virtual void map_and_mark()noexcept override{
10883 map_and_mark_for_gc(&**this);
10884 }
10885 };
10886
10887 //file_end
10888
10889 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/root_ptr/_body.hpp"
10890 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/root_ptr/deduction_guides.hpp"
10891 //deduction_guides.hpp
10892 //at namespace elc::defs::memory::ptr_n
10893 /*
10894 未完成的elc解释器base文件
10895 由steve02081504与Alex0125设计、编写
10896 转载时请在不对此文件做任何修改的同时注明出处
10897 项目地址:https://github.com/steve02081504/ELC
10898 */
10899 template<class T>
10901
10902 //file_end
10903
10904 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/root_ptr/_body.hpp"
10905
10906 BREAK_NAMESPACE//in namespace elc::defs
10907
10908 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/root_ptr/_export.hpp"
10909 //_export.hpp
10910 //at namespace elc::defs
10911 /*
10912 未完成的elc解释器base文件
10913 由steve02081504与Alex0125设计、编写
10914 转载时请在不对此文件做任何修改的同时注明出处
10915 项目地址:https://github.com/steve02081504/ELC
10916 */
10917 INTER_NAMESPACE(memory)
10918 #define export using memory::ptr_n::
10920 #undef export
10922
10923 //file_end
10924
10925 #line 17 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/root_ptr/_body.hpp"
10926
10927 INTER_NAMESPACE(memory::gc_n)
10928
10929 //file_end
10930
10931 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/_body.hpp"
10932
10933 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/_export.hpp"
10934 //_export.hpp
10935 //at namespace elc::defs::memory::gc_n
10936 /*
10937 未完成的elc解释器base文件
10938 由steve02081504与Alex0125设计、编写
10939 转载时请在不对此文件做任何修改的同时注明出处
10940 项目地址:https://github.com/steve02081504/ELC
10941 */
10942 BREAK_NAMESPACE//in namespace elc::defs
10943 INTER_NAMESPACE(memory)
10944 #define export using gc_n::
10945 export gc;
10946 export have_root;
10947 export root_of;
10948 export mark_able_for_gc;
10949 export can_shrink;
10950 #undef export
10951 BREAK_NAMESPACE//in namespace elc::defs
10952 INTER_NAMESPACE(memory::gc_n)
10953
10954 //file_end
10955
10956 #line 18 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/_body.hpp"
10957
10958 #if defined(ELC_TEST_ON)
10959 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/_test.hpp"
10960 //_body.hpp
10961 //at namespace elc::defs::memory::gc_n
10962 /*
10963 未完成的elc解释器base文件
10964 由steve02081504与Alex0125设计、编写
10965 转载时请在不对此文件做任何修改的同时注明出处
10966 项目地址:https://github.com/steve02081504/ELC
10967 */
10968 #if!defined(_MSC_VER)//貌似msvc在这里有bug
10969 struct gc_tester:type_info_t<gc_tester>::template_name
10970 with_common_attribute<can_map_all,can_shrink,count_able,mark_able_for_gc,never_in_array,ref_able>,
10972 distinctive static inline int shrink_time=0;
10973 distinctive static inline int destroy_time=0;
10974 ~gc_tester()noexcept{destroy_time++;}
10975 void shrink(){
10976 shrink_time++;
10977 }
10978 static void reset_times(){
10979 shrink_time=destroy_time=0;
10980 }
10981 };
10982 static_assert(type_info<gc_tester>.base_on<can_map_all<gc_tester>>);
10983 void map_and_mark_for_gc(gc_tester*a){
10984 attribute_ptr_cast<mark_able_for_gc>(a)->mark();
10985 }
10986 void destory_by_gc(gc_tester*a){
10987 a->~gc_tester();
10988 }
10989 #endif
10990 inline void test(){
10991 #if!defined(_MSC_VER)
10992 ELC_TEST_EVENTNAME("gc部分测试");
10993 using ::std::time;
10994 using ::std::rand;
10995 using ::std::srand;
10996 srand((unsigned)time(nullptr));
10997 gc.add_gc_method(type_info<gc_tester>);
10998 for(int t=rand()%7;t--;)
10999 {
11000 int i;
11001 root_ptr_t<gc_tester> name=get<gc_tester>();
11002 for(i=rand()%72;i--;){
11003 #pragma warning(suppress: 4189)
11004 auto p=get<gc_tester>();
11005 }
11006 gc();
11007 stest_accert(gc_tester::shrink_time==i+1);
11008 stest_accert(gc_tester::destroy_time==i);
11009 stest_accert(get_size_of_get(&*name)==1);
11010 }
11011 check_memory_lack();
11012 #endif
11013 }
11014 inline void test_log_out(){
11015
11016 }
11017 inline void test_end(){
11018
11019 }
11020
11021 //file_end
11022
11023 #line 21 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/_body.hpp"
11024 #endif
11025
11026 //file_end
11027
11028 #line 40 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/_body.hpp"
11029 }
11030 using namespace memory;//只是强迫症
11031
11032 #if defined(ELC_TEST_ON)
11033 namespace base_part_test{
11034 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/_test.hpp"
11035 //_test.hpp
11036 //at namespace elc::defs::base_part_test
11037 /*
11038 未完成的elc解释器base文件
11039 由steve02081504与Alex0125设计、编写
11040 转载时请在不对此文件做任何修改的同时注明出处
11041 项目地址:https://github.com/steve02081504/ELC
11042 */
11043 inline void test(){
11044 ELC_TEST_EVENTNAME("base部分测试");
11045 memory::test();
11046 container::test();
11047 gc_n::test();
11048 }
11049 inline void test_log_out(){
11050 memory::test_log_out();
11051 container::test_log_out();
11052 }
11053 inline void test_end(){
11054 memory::test_end();
11055 container::test_end();
11056 }
11057
11058 //file_end
11059
11060 #line 46 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/_body.hpp"
11061 }
11062 #endif
11063
11064 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
11065 //_undefs.hpp
11066 /*
11067 未完成的elc解释器basic文件
11068 由steve02081504与Alex0125设计、编写
11069 转载时请在不对此文件做任何修改的同时注明出处
11070 项目地址:https://github.com/steve02081504/ELC
11071 */
11072 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_undefs.hpp"
11073 //_undefs.hpp
11074 /*
11075 未完成的elc解释器_share文件
11076 由steve02081504与Alex0125设计、编写
11077 转载时请在不对此文件做任何修改的同时注明出处
11078 项目地址:https://github.com/steve02081504/ELC
11079 */
11080
11081 //defs at "_defs.hpp"
11082
11083 #if defined(_MSC_VER)
11084 #pragma warning(pop)
11085 #endif
11086 #undef suppress_msvc_warning
11087 #undef disable_msvc_warning
11088 #undef push_msvc_warning
11089 #undef pop_msvc_warning
11090 #undef push_and_disable_msvc_warning
11091
11092 //for basic_environment.hpp
11093 #undef BIT_POSSIBILITY
11094 //
11095 #if defined(ELC_VOID_NAME)
11096 #define void the_void
11097 #endif
11098
11099 // #undef often_noexcept
11100 #undef noexcept_as
11101 #undef noexcept_as_auto
11102 #undef constexpr_as
11103 #undef constexpr_as_auto
11104
11105 #undef using_method_from_base_t
11106 #undef using_method_from_value
11107
11108 #undef floop
11109 #undef enable_adl
11110
11111 #undef re_declvalue
11112 #undef re_decltype
11113
11114 #undef declvalue
11115
11116 #undef template_error
11117 #undef template_warning
11118
11119 #undef type_info_of
11120 #undef type_name_of
11121
11122 #undef is_common_attribute
11123 #undef is_special_attribute
11124
11125 #undef has_attribute
11126 #undef not_has_attribute
11127
11128 #undef float_size_of
11129 #undef bitnum_of
11130
11131 #undef def_common_attribute_with_nothing
11132 #undef def_special_attribute_with_nothing
11133
11134 #undef common_attribute_t
11135 #undef special_attribute_t
11136
11137 #undef enable_if
11138 #undef enabled_by_default
11139 #undef disabled_by_default
11140 #undef enable_if_not_ill_form
11141 #undef enable_flag
11142
11143 #undef was_an_ill_form
11144 #undef was_an_ill_form_with_parameter
11145 #undef was_not_an_ill_form
11146 #undef was_not_an_ill_form_and_noexcept
11147 #undef was_not_an_ill_form_with_parameter
11148
11149 #undef recursive_lambda
11150 #undef get_recursive_lambda_caller
11151 #undef lambda
11152 #undef lambda_with_catch
11153 #undef self_recursion
11154 #undef lambda_RLSRRS
11155
11156 #undef MAGIC
11157
11158 #undef nothing
11159
11160 #undef elseif
11161 #undef _big_than_
11162 #undef _small_than_
11163
11164 #if defined(_MSC_VER)
11165 #undef not
11166 #undef and
11167 #undef or
11168 #endif
11169
11170 #undef INTER_NAMESPACE
11171 #undef BREAK_NAMESPACE
11172
11173 #undef szie
11174 #undef form
11175
11176 #undef template_name
11177 #undef type_name
11178
11179 #undef not_in_debug
11180
11181 #undef es
11182 #undef ec
11183
11184 #undef ELC_TEST_EVENTNAME
11185
11186 #undef override_instance_struct
11187
11188 #undef distinctive
11189
11190 #undef force_inline
11191
11192 #undef with_no_vtable
11193
11194 #undef in_consteval
11195
11196 #undef no_vtable_struct
11197 #undef no_vtable_class
11198
11199 //file_end
11200
11201 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
11202
11203 //file_end
11204
11205 #line 50 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/_body.hpp"
11206 }
11207 namespace elc{
11208 //导出base承诺于名称空间elc中提供的内容
11209 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/_export.hpp"
11210 //_export.hpp
11211 //at namespace elc
11212 /*
11213 未完成的elc解释器base文件
11214 由steve02081504与Alex0125设计、编写
11215 转载时请在不对此文件做任何修改的同时注明出处
11216 项目地址:https://github.com/steve02081504/ELC
11217 */
11218 #define export using defs::base::
11219 #undef export
11220
11221 //file_end
11222
11223 #line 53 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/_body.hpp"
11224 }
11225
11226 //file_end
11227
11228 #line 17 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base"
11229 #endif
11230
11231 //file_end
11232
11233 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/all"
11234 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base_defs"
11235 //base_defs
11236 //at namespace ::
11237 /*
11238 未完成的elc解释器include文件
11239 由steve02081504与Alex0125设计、编写
11240 转载时请在不对此文件做任何修改的同时注明出处
11241 项目地址:https://github.com/steve02081504/ELC
11242 */
11243 #line 22 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base_defs"
11244
11245 //file_end
11246
11247 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/all"
11248 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base_exception"
11249 //base_exception
11250 //at namespace ::
11251 /*
11252 未完成的elc解释器include文件
11253 由steve02081504与Alex0125设计、编写
11254 转载时请在不对此文件做任何修改的同时注明出处
11255 项目地址:https://github.com/steve02081504/ELC
11256 */
11257 #if !defined(ELC_BASE_EXCEPTION)
11258 #define ELC_BASE_EXCEPTION
11259 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/locale/using.hpp"
11260 //using.hpp
11261 /*
11262 未完成的elc解释器_share文件
11263 由steve02081504与Alex0125设计、编写
11264 转载时请在不对此文件做任何修改的同时注明出处
11265 项目地址:https://github.com/steve02081504/ELC
11266 */
11267 /*
11268 locale说明
11269 elc使用的字符串.
11270 调整这些,实现快速本地化.
11271 */
11272 #line 26 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/locale/using.hpp"
11273
11274 //file_end
11275
11276 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base_exception"
11277 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_exception/_body.hpp"
11278 //_body.hpp
11279 //at namespace ::
11280 /*
11281 未完成的elc解释器base_exception文件
11282 由steve02081504与Alex0125设计、编写
11283 转载时请在不对此文件做任何修改的同时注明出处
11284 项目地址:https://github.com/steve02081504/ELC
11285 */
11286 #if defined(ELC_TEST)
11287 #error "this part cannot be tested."
11288 #endif
11289 //char_t
11290 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/default_data_type.hpp"
11291 //default_data_type.hpp
11292 /*
11293 未完成的elc解释器_share文件
11294 由steve02081504与Alex0125设计、编写
11295 转载时请在不对此文件做任何修改的同时注明出处
11296 项目地址:https://github.com/steve02081504/ELC
11297 */
11298 namespace elc{
11299 /*ELC内部string统一采用char_t宽字符,使用setlocale(LC_ALL,"en_US.utf8")下的UTF编码。*/
11300 typedef char32_t char_t;
11301 /*ELC内部钦定int_t类型*/
11302 typedef int64_t int_t;
11303 /*ELC内部钦定uint_t类型*/
11304 typedef uint64_t uint_t;
11305 /*ELC内部钦定float_t类型*/
11306 typedef double float_t;
11307 /*ELC内部钦定float_size_t类型,用以描述内存大小的浮点状况*/
11308 typedef long double float_size_t;
11309 }
11310
11311 //file_end
11312
11313 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_exception/_body.hpp"
11314 namespace elc::defs{
11315 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
11316 //_defs.hpp
11317 /*
11318 未完成的elc解释器basic文件
11319 由steve02081504与Alex0125设计、编写
11320 转载时请在不对此文件做任何修改的同时注明出处
11321 项目地址:https://github.com/steve02081504/ELC
11322 */
11323 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
11324 //_defs.hpp
11325 /*
11326 未完成的elc解释器_share文件
11327 由steve02081504与Alex0125设计、编写
11328 转载时请在不对此文件做任何修改的同时注明出处
11329 项目地址:https://github.com/steve02081504/ELC
11330 */
11331
11332 //undefs at "_undefs.hpp"
11333
11334 //set ELC_WARNING_LEVEL default to 4(max)
11335 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
11336
11337 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/basic_environment.hpp"
11338 //basic_environment.hpp
11339 /*
11340 未完成的elc解释器_share文件
11341 由steve02081504与Alex0125设计、编写
11342 转载时请在不对此文件做任何修改的同时注明出处
11343 项目地址:https://github.com/steve02081504/ELC
11344 */
11345
11348 #define BIT_POSSIBILITY 2
11349
11350 //file_end
11351
11352 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
11353
11354 #if defined(_MSC_VER)
11355 #pragma warning(push,ELC_WARNING_LEVEL)
11356 #pragma warning(disable:4099)//class与struct混用警告diss
11357 #pragma warning(disable:26812)//enum class安利diss.
11358 #pragma warning(disable:4584)//重复子类警告diss
11359 #pragma warning(disable:4250)//域控制继承警告diss
11360 #pragma warning(disable:26432)//不完全默认方法警告diss
11361 #pragma warning(disable:26435)//virtual override方法警告diss
11362 #pragma warning(disable:26481)//容器安利diss
11363 #pragma warning(disable:26446)//gsl::at安利diss
11364 #pragma warning(disable:26434)//方法覆盖警告diss
11365 #pragma warning(disable:26429)//gsl::not_null安利diss
11366 #pragma warning(disable:26471)//对void*进行static_cast安利diss
11367 #pragma warning(disable:26474)//隐式指针转换显式cast警告diss
11368 #pragma warning(disable:26473)//相同指针显式cast警告diss
11369 #pragma warning(disable:26456)//隐藏非虚运算符警告diss
11370 #pragma warning(disable:26485)//数组作指针警告diss
11371 #pragma warning(disable:26490)//reinterpret_cast警告diss
11372 #pragma warning(disable:26472)//static_cast窄幅转换警告diss
11373 #pragma warning(disable:26482)//非常数数组索引警告diss
11374 #pragma warning(disable:26493)//c_cast转换警告diss:虽然有用但是太烦了,爬
11375 #endif
11376 #if defined(_MSC_VER)
11377 #define suppress_msvc_warning(...) __pragma(warning(suppress:__VA_ARGS__))
11378 #define disable_msvc_warning(...) __pragma(warning(disable:__VA_ARGS__))
11379 #define push_msvc_warning() __pragma(warning(push))
11380 #define pop_msvc_warning() __pragma(warning(pop))
11381 #define push_and_disable_msvc_warning(...) push_msvc_warning() disable_msvc_warning(__VA_ARGS__)
11382 #else
11383 #define suppress_msvc_warning(...)
11384 #define disable_msvc_warning(...)
11385 #define push_msvc_warning()
11386 #define pop_msvc_warning()
11387 #define push_and_disable_msvc_warning(...)
11388 #endif
11389 //
11390 #if defined(ELC_VOID_NAME)
11391 #undef void
11392 #endif
11393
11394 // #define often_noexcept
11395 #define noexcept_as(...) noexcept(noexcept((__VA_ARGS__)))//dnmd C艹标准就是没有noexcept_as_auto
11396 #define noexcept_as_auto MAGIC//哦现在有了
11397 #define constexpr_as(...) MAGIC constexpr//( •̀ ω •́ )✌
11398 #define constexpr_as_auto MAGIC MAGIC constexpr//✌( •̀ ω •́ )✌
11399
11400 #define using_method_from_base_t(name,...) \
11401 template<class...Args> requires was_not_an_ill_form(declvalue(base_t).name(declvalue(Args)...))\
11402 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(base_t::name(declvalue(Args)...))\
11403 {\
11404 return base_t::name(forward<Args>(rest)...);\
11405 }\
11406
11407 #define using_method_from_value(name,value_name,...) \
11408 template<class...Args> requires was_not_an_ill_form(re_declvalue(value_name).name(declvalue(Args)...))\
11409 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(re_declvalue(value_name).name(declvalue(Args)...))\
11410 {\
11411 return value_name.name(forward<Args>(rest)...);\
11412 }\
11413
11414 #define floop while(__builtin_is_my_dick_still_there())
11415 #define enable_adl(name) void name()noexcept=delete
11416
11417 #define re_declvalue(...) (declvalue(decltype(__VA_ARGS__)))
11418 #define re_decltype(...) (decltype(declvalue(__VA_ARGS__)))
11419
11420 #define declvalue(...) (::std::declval<__VA_ARGS__>())
11421
11423 #define template_error(reason) static_assert(template_error_helper<T>,reason)
11425 #define template_warning(reason) template_warning_helper<T>(reason)
11426
11427 //for type_info
11428 #define type_info_of(...) base_type_info_t(typeid(__VA_ARGS__))
11429 #define type_name_of(...) (type_info_of(__VA_ARGS__).name())
11430
11431 #define is_common_attribute(name) public attribute<T,name<T>>
11432 #define is_special_attribute(name) public attribute<T,name>
11433
11434 #define has_attribute(...) template_name has_attribute_helper<__VA_ARGS__>()
11435 #define not_has_attribute(...) template_name not_has_has_attribute_helper<__VA_ARGS__>()
11436
11437 //for float_size_t
11438 #define float_size_of(...) (float_size_t{sizeof(__VA_ARGS__)})
11439 //bitnum_of
11440 #define bitnum_of(...) (bitnumof<__VA_ARGS__>)
11441
11442 //for attribute
11443 #define def_common_attribute_with_nothing(name) \
11444 template<typename T>\
11445 class name{}\
11446
11447 #define def_special_attribute_with_nothing(name) \
11448 class name{}\
11449
11450 #define common_attribute_t template<class>class
11451 #define special_attribute_t class
11452
11461 #define enable_if(...) class enable_state= ::std::enable_if_t<__VA_ARGS__>
11463 #define enabled_by_default class enable_state=void
11465 #define disabled_by_default class enable_state= ::std::enable_if_t<false>
11467 #define enable_if_not_ill_form(...) class enable_state= ::std::void_t<decltype(__VA_ARGS__)>
11469 #define enable_flag class enable_state
11470
11471 #define was_an_ill_form(...) (!was_not_an_ill_form(__VA_ARGS__))
11472 #define was_an_ill_form_with_parameter(...) (!was_not_an_ill_form_with_parameter(__VA_ARGS__))
11473 #define was_not_an_ill_form(...) (bool(requires{__VA_ARGS__;}))
11474 #define was_not_an_ill_form_and_noexcept(...) (bool(requires{__VA_ARGS__;{__VA_ARGS__}noexcept;}))
11475 #define was_not_an_ill_form_with_parameter(...) (bool(requires __VA_ARGS__ ))
11476
11478 #define recursive_lambda(...) lambda(auto&&lambda_RLSRRS,__VA_ARGS__)
11480 #define get_recursive_lambda_caller(name) \
11481 lambda_with_catch(&)(auto&&...Args){\
11482 return name(name,Args...);\
11483 }
11485 #define lambda []
11487 #define lambda_with_catch(...) [__VA_ARGS__]
11489 #define self_recursion(...) lambda_RLSRRS(lambda_RLSRRS,__VA_ARGS__)
11490 //recursive_lambda_self_referential_reserved_symbolname
11491 #define lambda_RLSRRS _my_jb_super_sb_name_
11492
11493 #define MAGIC//ahh,ko no tenno da!
11494
11496 #define nothing
11497
11499 #define elseif else if
11501 #define _big_than_ >
11503 #define _small_than_ <
11504
11505 #if defined(_MSC_VER)
11506 #define not !
11507 #define and &&
11508 #define or ||
11509 #endif
11510
11512 #define INTER_NAMESPACE(NAMESPACENAME) namespace NAMESPACENAME{
11514 #define BREAK_NAMESPACE }
11515
11517 #define template_name template
11519 #define type_name class
11520
11521 #if defined(DEBUG) || defined(_DEBUG)
11522 #define not_in_debug 0
11523 #else
11524 #define not_in_debug 1
11525 #endif
11526
11527 #define es U""
11528 #define ec(ch) U ## ch
11529
11530 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
11531 #define ELC_TEST_EVENTNAME(name) stest_eventer _the_stest_eventer__(L""name)
11532 #else
11533 #define ELC_TEST_EVENTNAME(name)
11534 #endif
11535
11536 #define override_instance_struct \
11537 protected:\
11538 virtual void abstract_method_unget_this()noexcept_as(instance_struct<this_t>::abstract_method_unget_this())override{instance_struct<this_t>::abstract_method_unget_this();}\
11539 virtual void* _abstract_method_copy_get_this()noexcept_as(instance_struct<this_t>::_abstract_method_copy_get_this())override{return instance_struct<this_t>::_abstract_method_copy_get_this();}\
11540 virtual void* _abstract_method_get_resize_this(size_t size)noexcept_as(instance_struct<this_t>::instance_struct<this_t>::_abstract_method_get_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_resize_this(size);}\
11541 virtual void* _abstract_method_get_forward_resize_this(size_t size)noexcept_as(instance_struct<this_t>::_abstract_method_get_forward_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_forward_resize_this(size);}\
11542 virtual size_t abstract_method_get_size_of_get_for_this()noexcept override{return instance_struct<this_t>::abstract_method_get_size_of_get_for_this();}
11543
11544 #if defined(_WIN32)
11545 #define distinctive __declspec(dllexport)
11546 #else
11547 #define distinctive
11548 #endif
11549
11550 #if defined(_WIN32)
11551 #define force_inline __forceinline
11552 #elif defined(__GNUC__)
11553 #define force_inline __attribute__((always_inline)) inline
11554 #else
11555 #define force_inline inline
11556 #endif
11557
11558 #if defined(_WIN32)
11559 #define with_no_vtable __declspec(novtable)
11560 #else
11561 #define with_no_vtable
11562 #endif
11563
11564 #define in_consteval (::std::is_constant_evaluated())
11565
11566 #define no_vtable_struct struct with_no_vtable
11567 #define no_vtable_class class with_no_vtable
11568
11569 //file_end
11570
11571 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
11572
11573 //file_end
11574
11575 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_exception/_body.hpp"
11576
11577 namespace exception_n{
11578 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_exception/exception/_body.hpp"
11579 //_body.hpp
11580 //at namespace elc::defs::exception_n
11581 /*
11582 未完成的elc解释器base_exception文件
11583 由steve02081504与Alex0125设计、编写
11584 转载时请在不对此文件做任何修改的同时注明出处
11585 项目地址:https://github.com/steve02081504/ELC
11586 */
11587 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_exception/exception/exception.hpp"
11588 //_body.hpp
11589 //at namespace elc::defs::exception_n
11590 /*
11591 未完成的elc解释器base_exception文件
11592 由steve02081504与Alex0125设计、编写
11593 转载时请在不对此文件做任何修改的同时注明出处
11594 项目地址:https://github.com/steve02081504/ELC
11595 */
11597 const char_t* _constexpr_str=locale::str::exception::unknow_error;
11598 public:
11599 constexpr exception()noexcept=default;
11600 constexpr exception(const constexpr_str_t<char_t>&str)noexcept:_constexpr_str(str){}
11601 virtual constexpr ~exception()noexcept=0;
11602 virtual constexpr const char_t*what()noexcept{return _constexpr_str;}
11603 };
11604 inline constexpr exception::~exception()noexcept{}
11605
11607 using exception::exception;
11608 };
11609
11610 //file_end
11611
11612 #line 9 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_exception/exception/_body.hpp"
11613
11614 //file_end
11615
11616 #line 17 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_exception/_body.hpp"
11617 }
11618 namespace exceptions=exception_n;
11619
11620 #if defined(ELC_TEST_ON)
11621 namespace base_exception_part_test{
11622 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_exception/_test.hpp"
11623 //_test.hpp
11624 /*
11625 未完成的elc解释器base_exception文件
11626 由steve02081504与Alex0125设计、编写
11627 转载时请在不对此文件做任何修改的同时注明出处
11628 项目地址:https://github.com/steve02081504/ELC
11629 */
11630 inline void test(){
11631 ELC_TEST_EVENTNAME("base_exception部分测试");
11632 }
11633 inline void test_log_out(){
11634 }
11635 inline void test_end(){
11636 }
11637
11638 //file_end
11639
11640 #line 23 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_exception/_body.hpp"
11641 }
11642 #endif
11643
11644 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
11645 //_undefs.hpp
11646 /*
11647 未完成的elc解释器basic文件
11648 由steve02081504与Alex0125设计、编写
11649 转载时请在不对此文件做任何修改的同时注明出处
11650 项目地址:https://github.com/steve02081504/ELC
11651 */
11652 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_undefs.hpp"
11653 //_undefs.hpp
11654 /*
11655 未完成的elc解释器_share文件
11656 由steve02081504与Alex0125设计、编写
11657 转载时请在不对此文件做任何修改的同时注明出处
11658 项目地址:https://github.com/steve02081504/ELC
11659 */
11660
11661 //defs at "_defs.hpp"
11662
11663 #if defined(_MSC_VER)
11664 #pragma warning(pop)
11665 #endif
11666 #undef suppress_msvc_warning
11667 #undef disable_msvc_warning
11668 #undef push_msvc_warning
11669 #undef pop_msvc_warning
11670 #undef push_and_disable_msvc_warning
11671
11672 //for basic_environment.hpp
11673 #undef BIT_POSSIBILITY
11674 //
11675 #if defined(ELC_VOID_NAME)
11676 #define void the_void
11677 #endif
11678
11679 // #undef often_noexcept
11680 #undef noexcept_as
11681 #undef noexcept_as_auto
11682 #undef constexpr_as
11683 #undef constexpr_as_auto
11684
11685 #undef using_method_from_base_t
11686 #undef using_method_from_value
11687
11688 #undef floop
11689 #undef enable_adl
11690
11691 #undef re_declvalue
11692 #undef re_decltype
11693
11694 #undef declvalue
11695
11696 #undef template_error
11697 #undef template_warning
11698
11699 #undef type_info_of
11700 #undef type_name_of
11701
11702 #undef is_common_attribute
11703 #undef is_special_attribute
11704
11705 #undef has_attribute
11706 #undef not_has_attribute
11707
11708 #undef float_size_of
11709 #undef bitnum_of
11710
11711 #undef def_common_attribute_with_nothing
11712 #undef def_special_attribute_with_nothing
11713
11714 #undef common_attribute_t
11715 #undef special_attribute_t
11716
11717 #undef enable_if
11718 #undef enabled_by_default
11719 #undef disabled_by_default
11720 #undef enable_if_not_ill_form
11721 #undef enable_flag
11722
11723 #undef was_an_ill_form
11724 #undef was_an_ill_form_with_parameter
11725 #undef was_not_an_ill_form
11726 #undef was_not_an_ill_form_and_noexcept
11727 #undef was_not_an_ill_form_with_parameter
11728
11729 #undef recursive_lambda
11730 #undef get_recursive_lambda_caller
11731 #undef lambda
11732 #undef lambda_with_catch
11733 #undef self_recursion
11734 #undef lambda_RLSRRS
11735
11736 #undef MAGIC
11737
11738 #undef nothing
11739
11740 #undef elseif
11741 #undef _big_than_
11742 #undef _small_than_
11743
11744 #if defined(_MSC_VER)
11745 #undef not
11746 #undef and
11747 #undef or
11748 #endif
11749
11750 #undef INTER_NAMESPACE
11751 #undef BREAK_NAMESPACE
11752
11753 #undef szie
11754 #undef form
11755
11756 #undef template_name
11757 #undef type_name
11758
11759 #undef not_in_debug
11760
11761 #undef es
11762 #undef ec
11763
11764 #undef ELC_TEST_EVENTNAME
11765
11766 #undef override_instance_struct
11767
11768 #undef distinctive
11769
11770 #undef force_inline
11771
11772 #undef with_no_vtable
11773
11774 #undef in_consteval
11775
11776 #undef no_vtable_struct
11777 #undef no_vtable_class
11778
11779 //file_end
11780
11781 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
11782
11783 //file_end
11784
11785 #line 27 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_exception/_body.hpp"
11786 }
11787 namespace elc{
11788 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_exception/_export.hpp"
11789 //_export.hpp
11790 //at namespace elc
11791 /*
11792 未完成的elc解释器base_exception文件
11793 由steve02081504与Alex0125设计、编写
11794 转载时请在不对此文件做任何修改的同时注明出处
11795 项目地址:https://github.com/steve02081504/ELC
11796 */
11797 #define export using defs::exception_n::
11798 export exception;
11799 export runtime_exception;
11800 #undef export
11801
11802 //file_end
11803
11804 #line 30 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_exception/_body.hpp"
11805 }
11806
11807 //file_end
11808
11809 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base_exception"
11810 #endif
11811
11812 //file_end
11813
11814 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/all"
11815 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base_stream"
11816 //base_stream
11817 //at namespace ::
11818 /*
11819 未完成的elc解释器include文件
11820 由steve02081504与Alex0125设计、编写
11821 转载时请在不对此文件做任何修改的同时注明出处
11822 项目地址:https://github.com/steve02081504/ELC
11823 */
11824 #if !defined(ELC_BASE_STREAM)
11825 #define ELC_BASE_STREAM
11826 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_stream/_body.hpp"
11827 //_body.hpp
11828 //at namespace ::
11829 /*
11830 未完成的elc解释器base_stream文件
11831 由steve02081504与Alex0125设计、编写
11832 转载时请在不对此文件做任何修改的同时注明出处
11833 项目地址:https://github.com/steve02081504/ELC
11834 */
11835 #if defined(ELC_TEST)
11836 #error "this part cannot be tested."
11837 #endif
11838 namespace elc::defs{
11839 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
11840 //_defs.hpp
11841 /*
11842 未完成的elc解释器basic文件
11843 由steve02081504与Alex0125设计、编写
11844 转载时请在不对此文件做任何修改的同时注明出处
11845 项目地址:https://github.com/steve02081504/ELC
11846 */
11847 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
11848 //_defs.hpp
11849 /*
11850 未完成的elc解释器_share文件
11851 由steve02081504与Alex0125设计、编写
11852 转载时请在不对此文件做任何修改的同时注明出处
11853 项目地址:https://github.com/steve02081504/ELC
11854 */
11855
11856 //undefs at "_undefs.hpp"
11857
11858 //set ELC_WARNING_LEVEL default to 4(max)
11859 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
11860
11861 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/basic_environment.hpp"
11862 //basic_environment.hpp
11863 /*
11864 未完成的elc解释器_share文件
11865 由steve02081504与Alex0125设计、编写
11866 转载时请在不对此文件做任何修改的同时注明出处
11867 项目地址:https://github.com/steve02081504/ELC
11868 */
11869
11872 #define BIT_POSSIBILITY 2
11873
11874 //file_end
11875
11876 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
11877
11878 #if defined(_MSC_VER)
11879 #pragma warning(push,ELC_WARNING_LEVEL)
11880 #pragma warning(disable:4099)//class与struct混用警告diss
11881 #pragma warning(disable:26812)//enum class安利diss.
11882 #pragma warning(disable:4584)//重复子类警告diss
11883 #pragma warning(disable:4250)//域控制继承警告diss
11884 #pragma warning(disable:26432)//不完全默认方法警告diss
11885 #pragma warning(disable:26435)//virtual override方法警告diss
11886 #pragma warning(disable:26481)//容器安利diss
11887 #pragma warning(disable:26446)//gsl::at安利diss
11888 #pragma warning(disable:26434)//方法覆盖警告diss
11889 #pragma warning(disable:26429)//gsl::not_null安利diss
11890 #pragma warning(disable:26471)//对void*进行static_cast安利diss
11891 #pragma warning(disable:26474)//隐式指针转换显式cast警告diss
11892 #pragma warning(disable:26473)//相同指针显式cast警告diss
11893 #pragma warning(disable:26456)//隐藏非虚运算符警告diss
11894 #pragma warning(disable:26485)//数组作指针警告diss
11895 #pragma warning(disable:26490)//reinterpret_cast警告diss
11896 #pragma warning(disable:26472)//static_cast窄幅转换警告diss
11897 #pragma warning(disable:26482)//非常数数组索引警告diss
11898 #pragma warning(disable:26493)//c_cast转换警告diss:虽然有用但是太烦了,爬
11899 #endif
11900 #if defined(_MSC_VER)
11901 #define suppress_msvc_warning(...) __pragma(warning(suppress:__VA_ARGS__))
11902 #define disable_msvc_warning(...) __pragma(warning(disable:__VA_ARGS__))
11903 #define push_msvc_warning() __pragma(warning(push))
11904 #define pop_msvc_warning() __pragma(warning(pop))
11905 #define push_and_disable_msvc_warning(...) push_msvc_warning() disable_msvc_warning(__VA_ARGS__)
11906 #else
11907 #define suppress_msvc_warning(...)
11908 #define disable_msvc_warning(...)
11909 #define push_msvc_warning()
11910 #define pop_msvc_warning()
11911 #define push_and_disable_msvc_warning(...)
11912 #endif
11913 //
11914 #if defined(ELC_VOID_NAME)
11915 #undef void
11916 #endif
11917
11918 // #define often_noexcept
11919 #define noexcept_as(...) noexcept(noexcept((__VA_ARGS__)))//dnmd C艹标准就是没有noexcept_as_auto
11920 #define noexcept_as_auto MAGIC//哦现在有了
11921 #define constexpr_as(...) MAGIC constexpr//( •̀ ω •́ )✌
11922 #define constexpr_as_auto MAGIC MAGIC constexpr//✌( •̀ ω •́ )✌
11923
11924 #define using_method_from_base_t(name,...) \
11925 template<class...Args> requires was_not_an_ill_form(declvalue(base_t).name(declvalue(Args)...))\
11926 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(base_t::name(declvalue(Args)...))\
11927 {\
11928 return base_t::name(forward<Args>(rest)...);\
11929 }\
11930
11931 #define using_method_from_value(name,value_name,...) \
11932 template<class...Args> requires was_not_an_ill_form(re_declvalue(value_name).name(declvalue(Args)...))\
11933 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(re_declvalue(value_name).name(declvalue(Args)...))\
11934 {\
11935 return value_name.name(forward<Args>(rest)...);\
11936 }\
11937
11938 #define floop while(__builtin_is_my_dick_still_there())
11939 #define enable_adl(name) void name()noexcept=delete
11940
11941 #define re_declvalue(...) (declvalue(decltype(__VA_ARGS__)))
11942 #define re_decltype(...) (decltype(declvalue(__VA_ARGS__)))
11943
11944 #define declvalue(...) (::std::declval<__VA_ARGS__>())
11945
11947 #define template_error(reason) static_assert(template_error_helper<T>,reason)
11949 #define template_warning(reason) template_warning_helper<T>(reason)
11950
11951 //for type_info
11952 #define type_info_of(...) base_type_info_t(typeid(__VA_ARGS__))
11953 #define type_name_of(...) (type_info_of(__VA_ARGS__).name())
11954
11955 #define is_common_attribute(name) public attribute<T,name<T>>
11956 #define is_special_attribute(name) public attribute<T,name>
11957
11958 #define has_attribute(...) template_name has_attribute_helper<__VA_ARGS__>()
11959 #define not_has_attribute(...) template_name not_has_has_attribute_helper<__VA_ARGS__>()
11960
11961 //for float_size_t
11962 #define float_size_of(...) (float_size_t{sizeof(__VA_ARGS__)})
11963 //bitnum_of
11964 #define bitnum_of(...) (bitnumof<__VA_ARGS__>)
11965
11966 //for attribute
11967 #define def_common_attribute_with_nothing(name) \
11968 template<typename T>\
11969 class name{}\
11970
11971 #define def_special_attribute_with_nothing(name) \
11972 class name{}\
11973
11974 #define common_attribute_t template<class>class
11975 #define special_attribute_t class
11976
11985 #define enable_if(...) class enable_state= ::std::enable_if_t<__VA_ARGS__>
11987 #define enabled_by_default class enable_state=void
11989 #define disabled_by_default class enable_state= ::std::enable_if_t<false>
11991 #define enable_if_not_ill_form(...) class enable_state= ::std::void_t<decltype(__VA_ARGS__)>
11993 #define enable_flag class enable_state
11994
11995 #define was_an_ill_form(...) (!was_not_an_ill_form(__VA_ARGS__))
11996 #define was_an_ill_form_with_parameter(...) (!was_not_an_ill_form_with_parameter(__VA_ARGS__))
11997 #define was_not_an_ill_form(...) (bool(requires{__VA_ARGS__;}))
11998 #define was_not_an_ill_form_and_noexcept(...) (bool(requires{__VA_ARGS__;{__VA_ARGS__}noexcept;}))
11999 #define was_not_an_ill_form_with_parameter(...) (bool(requires __VA_ARGS__ ))
12000
12002 #define recursive_lambda(...) lambda(auto&&lambda_RLSRRS,__VA_ARGS__)
12004 #define get_recursive_lambda_caller(name) \
12005 lambda_with_catch(&)(auto&&...Args){\
12006 return name(name,Args...);\
12007 }
12009 #define lambda []
12011 #define lambda_with_catch(...) [__VA_ARGS__]
12013 #define self_recursion(...) lambda_RLSRRS(lambda_RLSRRS,__VA_ARGS__)
12014 //recursive_lambda_self_referential_reserved_symbolname
12015 #define lambda_RLSRRS _my_jb_super_sb_name_
12016
12017 #define MAGIC//ahh,ko no tenno da!
12018
12020 #define nothing
12021
12023 #define elseif else if
12025 #define _big_than_ >
12027 #define _small_than_ <
12028
12029 #if defined(_MSC_VER)
12030 #define not !
12031 #define and &&
12032 #define or ||
12033 #endif
12034
12036 #define INTER_NAMESPACE(NAMESPACENAME) namespace NAMESPACENAME{
12038 #define BREAK_NAMESPACE }
12039
12041 #define template_name template
12043 #define type_name class
12044
12045 #if defined(DEBUG) || defined(_DEBUG)
12046 #define not_in_debug 0
12047 #else
12048 #define not_in_debug 1
12049 #endif
12050
12051 #define es U""
12052 #define ec(ch) U ## ch
12053
12054 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
12055 #define ELC_TEST_EVENTNAME(name) stest_eventer _the_stest_eventer__(L""name)
12056 #else
12057 #define ELC_TEST_EVENTNAME(name)
12058 #endif
12059
12060 #define override_instance_struct \
12061 protected:\
12062 virtual void abstract_method_unget_this()noexcept_as(instance_struct<this_t>::abstract_method_unget_this())override{instance_struct<this_t>::abstract_method_unget_this();}\
12063 virtual void* _abstract_method_copy_get_this()noexcept_as(instance_struct<this_t>::_abstract_method_copy_get_this())override{return instance_struct<this_t>::_abstract_method_copy_get_this();}\
12064 virtual void* _abstract_method_get_resize_this(size_t size)noexcept_as(instance_struct<this_t>::instance_struct<this_t>::_abstract_method_get_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_resize_this(size);}\
12065 virtual void* _abstract_method_get_forward_resize_this(size_t size)noexcept_as(instance_struct<this_t>::_abstract_method_get_forward_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_forward_resize_this(size);}\
12066 virtual size_t abstract_method_get_size_of_get_for_this()noexcept override{return instance_struct<this_t>::abstract_method_get_size_of_get_for_this();}
12067
12068 #if defined(_WIN32)
12069 #define distinctive __declspec(dllexport)
12070 #else
12071 #define distinctive
12072 #endif
12073
12074 #if defined(_WIN32)
12075 #define force_inline __forceinline
12076 #elif defined(__GNUC__)
12077 #define force_inline __attribute__((always_inline)) inline
12078 #else
12079 #define force_inline inline
12080 #endif
12081
12082 #if defined(_WIN32)
12083 #define with_no_vtable __declspec(novtable)
12084 #else
12085 #define with_no_vtable
12086 #endif
12087
12088 #define in_consteval (::std::is_constant_evaluated())
12089
12090 #define no_vtable_struct struct with_no_vtable
12091 #define no_vtable_class class with_no_vtable
12092
12093 //file_end
12094
12095 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
12096
12097 //file_end
12098
12099 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_stream/_body.hpp"
12100
12101 namespace stream_n{
12102 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_stream/base_streams/_body.hpp"
12103 //_body.hpp
12104 //at namespace elc
12105 /*
12106 未完成的elc解释器base_stream文件
12107 由steve02081504与Alex0125设计、编写
12108 转载时请在不对此文件做任何修改的同时注明出处
12109 项目地址:https://github.com/steve02081504/ELC
12110 */
12114 virtual ~base_stream()=default;
12115 virtual void*seek(seek_type,int_t)=0;
12116 virtual void*tell(){return this->seek(cur,0);}
12117 virtual void seek_to(void*)=0;
12118 virtual void sync()=0;
12119 virtual void flush()=0;
12120 virtual void close()=0;
12121 };
12123 virtual ~base_ostream()=default;
12124 virtual void write(const byte*buf,size_t size)=0;
12125 template<class T>
12126 void write(const T*v,size_t size=1){
12127 this->write(cast_to_data(v),size*sizeof(T));
12128 }
12129 };
12131 virtual ~base_istream()=default;
12132 virtual size_t read(byte*buf,size_t size)=0;
12133 template<class T>
12134 size_t read(T*v,size_t size=1){
12135 return this->read(cast_to_data(v),size*sizeof(T))/sizeof(T);
12136 }
12137 };
12139
12140
12142 virtual ~noexcept_stream()noexcept override=default;
12143 virtual void*seek(seek_type,int_t)noexcept override=0;
12144 virtual void*tell()noexcept override{return this->seek(cur,0);}
12145 virtual void seek_to(void*)noexcept override=0;
12146 virtual void sync()noexcept override=0;
12147 virtual void flush()noexcept override=0;
12148 virtual void close()noexcept override=0;
12149 };
12151 virtual void write(const byte*buf,size_t size)noexcept override=0;
12152 template<class T>
12153 void write(const T*v,size_t size=1)noexcept{
12154 this->write(cast_to_data(v),size*sizeof(T));
12155 }
12156 };
12158 virtual size_t read(byte*buf,size_t size)noexcept override=0;
12159 template<class T>
12160 size_t read(T*v,size_t size=1)noexcept{
12161 return this->read(cast_to_data(v),size*sizeof(T))/sizeof(T);
12162 }
12163 };
12165 static_assert(noexcept(((noexcept_iostream*)(nullptr))->~noexcept_iostream()));
12166 static_assert(noexcept(((noexcept_iostream*)(nullptr))->sync()));
12167
12168 //string streams
12172 //noexcept_
12176
12177
12178 //data streams
12182 //noexcept_
12186
12188
12189 //file_end
12190
12191 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_stream/_body.hpp"
12192 }
12193 using namespace stream_n;
12194
12195 #if defined(ELC_TEST_ON)
12196 namespace base_stream_part_test{
12197 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_stream/_test.hpp"
12198 //_test.hpp
12199 /*
12200 未完成的elc解释器base_stream文件
12201 由steve02081504与Alex0125设计、编写
12202 转载时请在不对此文件做任何修改的同时注明出处
12203 项目地址:https://github.com/steve02081504/ELC
12204 */
12205 inline void test(){
12206 ELC_TEST_EVENTNAME("base_stream部分测试");
12207 }
12208 inline void test_log_out(){
12209 }
12210 inline void test_end(){
12211 }
12212
12213 //file_end
12214
12215 #line 22 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_stream/_body.hpp"
12216 }
12217 #endif
12218
12219 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
12220 //_undefs.hpp
12221 /*
12222 未完成的elc解释器basic文件
12223 由steve02081504与Alex0125设计、编写
12224 转载时请在不对此文件做任何修改的同时注明出处
12225 项目地址:https://github.com/steve02081504/ELC
12226 */
12227 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_undefs.hpp"
12228 //_undefs.hpp
12229 /*
12230 未完成的elc解释器_share文件
12231 由steve02081504与Alex0125设计、编写
12232 转载时请在不对此文件做任何修改的同时注明出处
12233 项目地址:https://github.com/steve02081504/ELC
12234 */
12235
12236 //defs at "_defs.hpp"
12237
12238 #if defined(_MSC_VER)
12239 #pragma warning(pop)
12240 #endif
12241 #undef suppress_msvc_warning
12242 #undef disable_msvc_warning
12243 #undef push_msvc_warning
12244 #undef pop_msvc_warning
12245 #undef push_and_disable_msvc_warning
12246
12247 //for basic_environment.hpp
12248 #undef BIT_POSSIBILITY
12249 //
12250 #if defined(ELC_VOID_NAME)
12251 #define void the_void
12252 #endif
12253
12254 // #undef often_noexcept
12255 #undef noexcept_as
12256 #undef noexcept_as_auto
12257 #undef constexpr_as
12258 #undef constexpr_as_auto
12259
12260 #undef using_method_from_base_t
12261 #undef using_method_from_value
12262
12263 #undef floop
12264 #undef enable_adl
12265
12266 #undef re_declvalue
12267 #undef re_decltype
12268
12269 #undef declvalue
12270
12271 #undef template_error
12272 #undef template_warning
12273
12274 #undef type_info_of
12275 #undef type_name_of
12276
12277 #undef is_common_attribute
12278 #undef is_special_attribute
12279
12280 #undef has_attribute
12281 #undef not_has_attribute
12282
12283 #undef float_size_of
12284 #undef bitnum_of
12285
12286 #undef def_common_attribute_with_nothing
12287 #undef def_special_attribute_with_nothing
12288
12289 #undef common_attribute_t
12290 #undef special_attribute_t
12291
12292 #undef enable_if
12293 #undef enabled_by_default
12294 #undef disabled_by_default
12295 #undef enable_if_not_ill_form
12296 #undef enable_flag
12297
12298 #undef was_an_ill_form
12299 #undef was_an_ill_form_with_parameter
12300 #undef was_not_an_ill_form
12301 #undef was_not_an_ill_form_and_noexcept
12302 #undef was_not_an_ill_form_with_parameter
12303
12304 #undef recursive_lambda
12305 #undef get_recursive_lambda_caller
12306 #undef lambda
12307 #undef lambda_with_catch
12308 #undef self_recursion
12309 #undef lambda_RLSRRS
12310
12311 #undef MAGIC
12312
12313 #undef nothing
12314
12315 #undef elseif
12316 #undef _big_than_
12317 #undef _small_than_
12318
12319 #if defined(_MSC_VER)
12320 #undef not
12321 #undef and
12322 #undef or
12323 #endif
12324
12325 #undef INTER_NAMESPACE
12326 #undef BREAK_NAMESPACE
12327
12328 #undef szie
12329 #undef form
12330
12331 #undef template_name
12332 #undef type_name
12333
12334 #undef not_in_debug
12335
12336 #undef es
12337 #undef ec
12338
12339 #undef ELC_TEST_EVENTNAME
12340
12341 #undef override_instance_struct
12342
12343 #undef distinctive
12344
12345 #undef force_inline
12346
12347 #undef with_no_vtable
12348
12349 #undef in_consteval
12350
12351 #undef no_vtable_struct
12352 #undef no_vtable_class
12353
12354 //file_end
12355
12356 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
12357
12358 //file_end
12359
12360 #line 26 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_stream/_body.hpp"
12361 }
12362 namespace elc{
12363 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_stream/_export.hpp"
12364 //_export.hpp
12365 //at namespace elc
12366 /*
12367 未完成的elc解释器base_stream文件
12368 由steve02081504与Alex0125设计、编写
12369 转载时请在不对此文件做任何修改的同时注明出处
12370 项目地址:https://github.com/steve02081504/ELC
12371 */
12372 #define export using defs::
12373 export base_stream;
12374 export base_ostream;
12375 export base_istream;
12376 export base_iostream;
12377 export noexcept_stream;
12378 export noexcept_ostream;
12379 export noexcept_istream;
12380 export noexcept_iostream;
12381 #undef export
12382
12383 //file_end
12384
12385 #line 29 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_stream/_body.hpp"
12386 }
12387
12388 //file_end
12389
12390 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base_stream"
12391 #endif
12392
12393 //file_end
12394
12395 #line 15 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/all"
12396 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/core"
12397 //core
12398 //at namespace ::
12399 /*
12400 未完成的elc解释器include文件
12401 由steve02081504与Alex0125设计、编写
12402 转载时请在不对此文件做任何修改的同时注明出处
12403 项目地址:https://github.com/steve02081504/ELC
12404 */
12405 #if !defined(ELC_CORE)
12406 #define ELC_CORE
12407 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base"
12408 //base
12409 //at namespace ::
12410 /*
12411 未完成的elc解释器include文件
12412 由steve02081504与Alex0125设计、编写
12413 转载时请在不对此文件做任何修改的同时注明出处
12414 项目地址:https://github.com/steve02081504/ELC
12415 */
12416 #line 18 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base"
12417
12418 //file_end
12419
12420 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/core"
12421 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base_exception"
12422 //base_exception
12423 //at namespace ::
12424 /*
12425 未完成的elc解释器include文件
12426 由steve02081504与Alex0125设计、编写
12427 转载时请在不对此文件做任何修改的同时注明出处
12428 项目地址:https://github.com/steve02081504/ELC
12429 */
12430 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base_exception"
12431
12432 //file_end
12433
12434 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/core"
12435 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base_stream"
12436 //base_stream
12437 //at namespace ::
12438 /*
12439 未完成的elc解释器include文件
12440 由steve02081504与Alex0125设计、编写
12441 转载时请在不对此文件做任何修改的同时注明出处
12442 项目地址:https://github.com/steve02081504/ELC
12443 */
12444 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base_stream"
12445
12446 //file_end
12447
12448 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/core"
12449 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/_body.hpp"
12450 //_body.hpp
12451 //at namespace ::
12452 /*
12453 未完成的elc解释器core文件
12454 由steve02081504与Alex0125设计、编写
12455 转载时请在不对此文件做任何修改的同时注明出处
12456 项目地址:https://github.com/steve02081504/ELC
12457 */
12458 #if defined(ELC_TEST)
12459 #error "this part cannot be tested."
12460 #endif
12461 namespace elc::defs{
12462 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
12463 //_defs.hpp
12464 /*
12465 未完成的elc解释器basic文件
12466 由steve02081504与Alex0125设计、编写
12467 转载时请在不对此文件做任何修改的同时注明出处
12468 项目地址:https://github.com/steve02081504/ELC
12469 */
12470 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
12471 //_defs.hpp
12472 /*
12473 未完成的elc解释器_share文件
12474 由steve02081504与Alex0125设计、编写
12475 转载时请在不对此文件做任何修改的同时注明出处
12476 项目地址:https://github.com/steve02081504/ELC
12477 */
12478
12479 //undefs at "_undefs.hpp"
12480
12481 //set ELC_WARNING_LEVEL default to 4(max)
12482 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
12483
12484 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/basic_environment.hpp"
12485 //basic_environment.hpp
12486 /*
12487 未完成的elc解释器_share文件
12488 由steve02081504与Alex0125设计、编写
12489 转载时请在不对此文件做任何修改的同时注明出处
12490 项目地址:https://github.com/steve02081504/ELC
12491 */
12492
12495 #define BIT_POSSIBILITY 2
12496
12497 //file_end
12498
12499 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
12500
12501 #if defined(_MSC_VER)
12502 #pragma warning(push,ELC_WARNING_LEVEL)
12503 #pragma warning(disable:4099)//class与struct混用警告diss
12504 #pragma warning(disable:26812)//enum class安利diss.
12505 #pragma warning(disable:4584)//重复子类警告diss
12506 #pragma warning(disable:4250)//域控制继承警告diss
12507 #pragma warning(disable:26432)//不完全默认方法警告diss
12508 #pragma warning(disable:26435)//virtual override方法警告diss
12509 #pragma warning(disable:26481)//容器安利diss
12510 #pragma warning(disable:26446)//gsl::at安利diss
12511 #pragma warning(disable:26434)//方法覆盖警告diss
12512 #pragma warning(disable:26429)//gsl::not_null安利diss
12513 #pragma warning(disable:26471)//对void*进行static_cast安利diss
12514 #pragma warning(disable:26474)//隐式指针转换显式cast警告diss
12515 #pragma warning(disable:26473)//相同指针显式cast警告diss
12516 #pragma warning(disable:26456)//隐藏非虚运算符警告diss
12517 #pragma warning(disable:26485)//数组作指针警告diss
12518 #pragma warning(disable:26490)//reinterpret_cast警告diss
12519 #pragma warning(disable:26472)//static_cast窄幅转换警告diss
12520 #pragma warning(disable:26482)//非常数数组索引警告diss
12521 #pragma warning(disable:26493)//c_cast转换警告diss:虽然有用但是太烦了,爬
12522 #endif
12523 #if defined(_MSC_VER)
12524 #define suppress_msvc_warning(...) __pragma(warning(suppress:__VA_ARGS__))
12525 #define disable_msvc_warning(...) __pragma(warning(disable:__VA_ARGS__))
12526 #define push_msvc_warning() __pragma(warning(push))
12527 #define pop_msvc_warning() __pragma(warning(pop))
12528 #define push_and_disable_msvc_warning(...) push_msvc_warning() disable_msvc_warning(__VA_ARGS__)
12529 #else
12530 #define suppress_msvc_warning(...)
12531 #define disable_msvc_warning(...)
12532 #define push_msvc_warning()
12533 #define pop_msvc_warning()
12534 #define push_and_disable_msvc_warning(...)
12535 #endif
12536 //
12537 #if defined(ELC_VOID_NAME)
12538 #undef void
12539 #endif
12540
12541 // #define often_noexcept
12542 #define noexcept_as(...) noexcept(noexcept((__VA_ARGS__)))//dnmd C艹标准就是没有noexcept_as_auto
12543 #define noexcept_as_auto MAGIC//哦现在有了
12544 #define constexpr_as(...) MAGIC constexpr//( •̀ ω •́ )✌
12545 #define constexpr_as_auto MAGIC MAGIC constexpr//✌( •̀ ω •́ )✌
12546
12547 #define using_method_from_base_t(name,...) \
12548 template<class...Args> requires was_not_an_ill_form(declvalue(base_t).name(declvalue(Args)...))\
12549 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(base_t::name(declvalue(Args)...))\
12550 {\
12551 return base_t::name(forward<Args>(rest)...);\
12552 }\
12553
12554 #define using_method_from_value(name,value_name,...) \
12555 template<class...Args> requires was_not_an_ill_form(re_declvalue(value_name).name(declvalue(Args)...))\
12556 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(re_declvalue(value_name).name(declvalue(Args)...))\
12557 {\
12558 return value_name.name(forward<Args>(rest)...);\
12559 }\
12560
12561 #define floop while(__builtin_is_my_dick_still_there())
12562 #define enable_adl(name) void name()noexcept=delete
12563
12564 #define re_declvalue(...) (declvalue(decltype(__VA_ARGS__)))
12565 #define re_decltype(...) (decltype(declvalue(__VA_ARGS__)))
12566
12567 #define declvalue(...) (::std::declval<__VA_ARGS__>())
12568
12570 #define template_error(reason) static_assert(template_error_helper<T>,reason)
12572 #define template_warning(reason) template_warning_helper<T>(reason)
12573
12574 //for type_info
12575 #define type_info_of(...) base_type_info_t(typeid(__VA_ARGS__))
12576 #define type_name_of(...) (type_info_of(__VA_ARGS__).name())
12577
12578 #define is_common_attribute(name) public attribute<T,name<T>>
12579 #define is_special_attribute(name) public attribute<T,name>
12580
12581 #define has_attribute(...) template_name has_attribute_helper<__VA_ARGS__>()
12582 #define not_has_attribute(...) template_name not_has_has_attribute_helper<__VA_ARGS__>()
12583
12584 //for float_size_t
12585 #define float_size_of(...) (float_size_t{sizeof(__VA_ARGS__)})
12586 //bitnum_of
12587 #define bitnum_of(...) (bitnumof<__VA_ARGS__>)
12588
12589 //for attribute
12590 #define def_common_attribute_with_nothing(name) \
12591 template<typename T>\
12592 class name{}\
12593
12594 #define def_special_attribute_with_nothing(name) \
12595 class name{}\
12596
12597 #define common_attribute_t template<class>class
12598 #define special_attribute_t class
12599
12608 #define enable_if(...) class enable_state= ::std::enable_if_t<__VA_ARGS__>
12610 #define enabled_by_default class enable_state=void
12612 #define disabled_by_default class enable_state= ::std::enable_if_t<false>
12614 #define enable_if_not_ill_form(...) class enable_state= ::std::void_t<decltype(__VA_ARGS__)>
12616 #define enable_flag class enable_state
12617
12618 #define was_an_ill_form(...) (!was_not_an_ill_form(__VA_ARGS__))
12619 #define was_an_ill_form_with_parameter(...) (!was_not_an_ill_form_with_parameter(__VA_ARGS__))
12620 #define was_not_an_ill_form(...) (bool(requires{__VA_ARGS__;}))
12621 #define was_not_an_ill_form_and_noexcept(...) (bool(requires{__VA_ARGS__;{__VA_ARGS__}noexcept;}))
12622 #define was_not_an_ill_form_with_parameter(...) (bool(requires __VA_ARGS__ ))
12623
12625 #define recursive_lambda(...) lambda(auto&&lambda_RLSRRS,__VA_ARGS__)
12627 #define get_recursive_lambda_caller(name) \
12628 lambda_with_catch(&)(auto&&...Args){\
12629 return name(name,Args...);\
12630 }
12632 #define lambda []
12634 #define lambda_with_catch(...) [__VA_ARGS__]
12636 #define self_recursion(...) lambda_RLSRRS(lambda_RLSRRS,__VA_ARGS__)
12637 //recursive_lambda_self_referential_reserved_symbolname
12638 #define lambda_RLSRRS _my_jb_super_sb_name_
12639
12640 #define MAGIC//ahh,ko no tenno da!
12641
12643 #define nothing
12644
12646 #define elseif else if
12648 #define _big_than_ >
12650 #define _small_than_ <
12651
12652 #if defined(_MSC_VER)
12653 #define not !
12654 #define and &&
12655 #define or ||
12656 #endif
12657
12659 #define INTER_NAMESPACE(NAMESPACENAME) namespace NAMESPACENAME{
12661 #define BREAK_NAMESPACE }
12662
12664 #define template_name template
12666 #define type_name class
12667
12668 #if defined(DEBUG) || defined(_DEBUG)
12669 #define not_in_debug 0
12670 #else
12671 #define not_in_debug 1
12672 #endif
12673
12674 #define es U""
12675 #define ec(ch) U ## ch
12676
12677 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
12678 #define ELC_TEST_EVENTNAME(name) stest_eventer _the_stest_eventer__(L""name)
12679 #else
12680 #define ELC_TEST_EVENTNAME(name)
12681 #endif
12682
12683 #define override_instance_struct \
12684 protected:\
12685 virtual void abstract_method_unget_this()noexcept_as(instance_struct<this_t>::abstract_method_unget_this())override{instance_struct<this_t>::abstract_method_unget_this();}\
12686 virtual void* _abstract_method_copy_get_this()noexcept_as(instance_struct<this_t>::_abstract_method_copy_get_this())override{return instance_struct<this_t>::_abstract_method_copy_get_this();}\
12687 virtual void* _abstract_method_get_resize_this(size_t size)noexcept_as(instance_struct<this_t>::instance_struct<this_t>::_abstract_method_get_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_resize_this(size);}\
12688 virtual void* _abstract_method_get_forward_resize_this(size_t size)noexcept_as(instance_struct<this_t>::_abstract_method_get_forward_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_forward_resize_this(size);}\
12689 virtual size_t abstract_method_get_size_of_get_for_this()noexcept override{return instance_struct<this_t>::abstract_method_get_size_of_get_for_this();}
12690
12691 #if defined(_WIN32)
12692 #define distinctive __declspec(dllexport)
12693 #else
12694 #define distinctive
12695 #endif
12696
12697 #if defined(_WIN32)
12698 #define force_inline __forceinline
12699 #elif defined(__GNUC__)
12700 #define force_inline __attribute__((always_inline)) inline
12701 #else
12702 #define force_inline inline
12703 #endif
12704
12705 #if defined(_WIN32)
12706 #define with_no_vtable __declspec(novtable)
12707 #else
12708 #define with_no_vtable
12709 #endif
12710
12711 #define in_consteval (::std::is_constant_evaluated())
12712
12713 #define no_vtable_struct struct with_no_vtable
12714 #define no_vtable_class class with_no_vtable
12715
12716 //file_end
12717
12718 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
12719
12720 //file_end
12721
12722 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/_body.hpp"
12723
12724 namespace core{
12725 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/base_def/_body.hpp"
12726 //_body.hpp
12727 //at namespace elc::defs::core
12728 /*
12729 未完成的elc解释器base文件
12730 由steve02081504与Alex0125设计、编写
12731 转载时请在不对此文件做任何修改的同时注明出处
12732 项目地址:https://github.com/steve02081504/ELC
12733 */
12734 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/base_def/decl.hpp"
12735 //decl.hpp
12736 //at namespace elc::defs::core
12737 /*
12738 未完成的elc解释器core文件
12739 由steve02081504与Alex0125设计、编写
12740 转载时请在不对此文件做任何修改的同时注明出处
12741 项目地址:https://github.com/steve02081504/ELC
12742 */
12743 struct node_like;
12744 typedef comn_ptr_t<node_like>ptr;
12745 typedef weak_ptr_t<node_like>weak_ptr;
12746 typedef comn_ptr_t<const node_like>const_ptr;
12747 typedef weak_ptr_t<const node_like>const_weak_ptr;
12748 struct value;
12749
12751 namespace string_n{
12752 template<typename char_T>
12753 struct string_t;
12755 template<constexpr_str_n::constexpr_str_t_literal_helper str_helper>
12756 inline constexpr string operator""_elc_string()noexcept;
12757 }
12758 using string_n::string_t;
12759 using string_n::string;
12760 INTER_NAMESPACE(core)
12761
12762 template<typename T>
12763 [[nodiscard]]inline ptr make_long_term_binary_node_from(T a)noexcept;
12764
12765 template<typename T>
12766 constexpr bool as_ptr_nothrow_helper()noexcept{
12767 if constexpr(was_not_an_ill_form(ptr(&declvalue(T))))
12768 return noexcept(ptr(&declvalue(T)));
12770 return noexcept(const_ptr(&declvalue(T)));
12771 elseif constexpr(was_not_an_ill_form(static_cast<node_like&>(declvalue(T))))
12772 return noexcept(&static_cast<node_like&>(declvalue(T)));
12773 elseif constexpr(was_not_an_ill_form(static_cast<const node_like&>(declvalue(T))))
12774 return noexcept(&static_cast<const node_like&>(declvalue(T)));
12775 elseif constexpr(was_not_an_ill_form(static_cast<value&>(declvalue(T))))
12776 return noexcept(ptr(static_cast<value&>(declvalue(T))));
12777 elseif constexpr(was_not_an_ill_form(static_cast<const value&>(declvalue(T))))
12778 return noexcept(const_ptr(static_cast<value&>(declvalue(T))));
12779 elseif constexpr(was_not_an_ill_form(ptr(declvalue(T))))
12780 return noexcept(ptr(declvalue(T)));
12782 return noexcept(const_ptr(declvalue(T)));
12783 elseif constexpr(type_info<remove_cvref<T>> == type_info<char_t>)
12784 return noexcept(make_long_term_binary_node_from<char_t>(declvalue(T)));
12785 elseif constexpr(::std::is_integral_v<remove_cvref<T>>){
12786 if constexpr(::std::is_signed_v<remove_cvref<T>>)
12787 return noexcept(make_long_term_binary_node_from<int_t>(declvalue(T)));
12788 else
12789 return noexcept(make_long_term_binary_node_from<uint_t>(declvalue(T)));
12790 }
12791 elseif constexpr(::std::is_floating_point_v<remove_cvref<T>>)
12792 return noexcept(make_long_term_binary_node_from<float_t>(declvalue(T)));
12793 elseif constexpr(construct<string>.able<T>){
12794 return noexcept(make_long_term_binary_node_from<string>(declvalue(T)));
12795 }
12796 }
12797 template<typename T>
12798 decltype(auto) as_ptr(T&&a)noexcept(as_ptr_nothrow_helper<T>()){
12799 ELC_TEST_EVENTNAME("as_ptr转换");
12800 if constexpr(was_not_an_ill_form(ptr(&a)))
12801 return ptr(&a);
12802 elseif constexpr(was_not_an_ill_form(const_ptr(&a)))
12803 return const_ptr(&a);
12804 elseif constexpr(was_not_an_ill_form(static_cast<node_like&>(a)))
12805 return &static_cast<node_like&>(a);
12806 elseif constexpr(was_not_an_ill_form(static_cast<const node_like&>(a)))
12807 return &static_cast<const node_like&>(a);
12808 elseif constexpr(was_not_an_ill_form(static_cast<value&>(a)))
12809 return ptr(static_cast<value&>(a));
12810 elseif constexpr(was_not_an_ill_form(static_cast<const value&>(a)))
12811 return const_ptr(static_cast<value&>(a));
12812 elseif constexpr(was_not_an_ill_form(ptr(a)))
12813 return ptr(a);
12814 elseif constexpr(was_not_an_ill_form(const_ptr(a)))
12815 return const_ptr(a);
12816 elseif constexpr(type_info<remove_cvref<T>> == type_info<char_t>)
12817 return make_long_term_binary_node_from<char_t>(a);
12818 elseif constexpr(::std::is_integral_v<remove_cvref<T>>){
12819 if constexpr(::std::is_signed_v<remove_cvref<T>>)
12820 return make_long_term_binary_node_from<int_t>(a);
12821 else
12822 return make_long_term_binary_node_from<uint_t>(a);
12823 }
12824 elseif constexpr(::std::is_floating_point_v<remove_cvref<T>>)
12825 return make_long_term_binary_node_from<float_t>(a);
12826 elseif constexpr(construct<string>.able<T>){
12827 return make_long_term_binary_node_from<string>(a);
12828 }
12829 }
12830
12831 template<typename T>
12832 constexpr bool as_value_nothrow_helper()noexcept{
12833 if constexpr(was_not_an_ill_form(static_cast<value&>(declvalue(T))))
12834 return noexcept(static_cast<value&>(declvalue(T)));
12835 elseif constexpr(was_not_an_ill_form(static_cast<const value&>(declvalue(T))))
12836 return noexcept(static_cast<const value&>(declvalue(T)));
12838 if constexpr(type_info<decltype(as_ptr(declvalue(T)))> == type_info<ptr>)
12839 return noexcept(value(as_ptr(declvalue(T))));
12840 elseif constexpr(type_info<decltype(as_ptr(declvalue(T)))> == type_info<const_ptr>)
12841 return noexcept((const value)remove_const((const node_like*)as_ptr(declvalue(T))));
12842 }
12843 }
12844 template<typename T>
12845 decltype(auto) as_value(T&& a)noexcept(as_value_nothrow_helper<T>()){
12846 ELC_TEST_EVENTNAME("as_value转换");
12847 if constexpr(was_not_an_ill_form(static_cast<value&>(a)))
12848 return static_cast<value&>(a);
12849 elseif constexpr(was_not_an_ill_form(static_cast<const value&>(a)))
12850 return static_cast<const value&>(a);
12852 if constexpr(type_info<decltype(as_ptr(declvalue(T)))> == type_info<ptr>)
12853 return value(as_ptr(forward<T>(a)));
12854 elseif constexpr(type_info<decltype(as_ptr(declvalue(T)))> == type_info<const_ptr>)
12855 return (const value)remove_const((const node_like*)as_ptr(forward<T>(a)));
12856 }
12857 }
12858
12859 //file_end
12860
12861 #line 9 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/base_def/_body.hpp"
12862
12863 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/base_def/node_like.hpp"
12864 //defs.hpp
12865 //at namespace elc::defs::core
12866 /*
12867 未完成的elc解释器core文件
12868 由steve02081504与Alex0125设计、编写
12869 转载时请在不对此文件做任何修改的同时注明出处
12870 项目地址:https://github.com/steve02081504/ELC
12871 */
12872 [[nodiscard]]inline ptr make_list()noexcept;
12873 template<typename T,typename...Args>
12874 [[nodiscard]]inline ptr make_list(T&&first,Args&&...rest);
12875
12877 with_common_attribute<abstract_base,weak_ref_able,replace_able,ref_able>{
12878 public:
12880
12881 [[nodiscard]]virtual base_type_info_t get_type_info()const noexcept=0;
12882
12883 [[nodiscard]]virtual value be_eval();
12884 [[nodiscard]]virtual value be_call(ptr);
12885 protected:
12886 [[nodiscard]]virtual logical_bool equal_with(const_ptr)const noexcept=0;
12887 [[nodiscard]]virtual logical_bool eq_with(const_ptr a)const noexcept{return a.get()==this;}//不是a==this:ptr的opertaor==将调用在下方定义的pointer_equal,这会通过eq间接调用eq_with
12888 [[nodiscard]]virtual constexpr size_t equal_level()const noexcept{return 36;}
12889 [[nodiscard]]virtual constexpr size_t eq_level()const noexcept{return 36;}
12890 public:
12891 node_like()noexcept=default;
12892 node_like(never_ref_num_zero_t)noexcept{ attribute_ptr_cast<ref_able>(this)->init_never_ref_num_zero(); }
12893 virtual ~node_like()=default;
12894
12895 [[nodiscard]]virtual value arec(const value)=0;
12896
12897 [[nodiscard]]value operator[](const value index);
12898 [[nodiscard]]value operator[](auto&&index){
12899 return operator[](as_value(index));
12900 }
12901
12902 virtual void clear()noexcept=0;
12903
12904 [[nodiscard]]virtual explicit operator hash_t()const noexcept{return hash((void*)this);}
12905 void destroy()noexcept{
12906 this->be_replace_as(null_ptr);
12907 }
12908 virtual void be_replace_as(ptr a)noexcept{
12909 this->clear();
12911 }
12912
12913 [[nodiscard]]virtual explicit operator logical_bool()const noexcept{return true;}
12914 [[nodiscard]]explicit operator bool()const noexcept{return(bool)this->operator logical_bool();}
12915
12916 template<typename...Args>
12917 inline value operator()(Args&&...rest){return this->be_call(make_list(forward<Args>(rest)...));}
12918
12919 [[nodiscard]]logical_bool eq(const_ptr a)const noexcept{
12920 const auto this_eqlv = this->eq_level();
12921 const auto arg_eqlv = a->eq_level();
12922 if(this_eqlv _small_than_ arg_eqlv)
12923 return a->eq_with(this);
12924 elseif(this_eqlv _big_than_ arg_eqlv)
12925 return this->eq_with(a);
12926 else
12927 return this->eq_with(a)&&a->eq_with(this);
12928 }
12929 [[nodiscard]]logical_bool equal(const_ptr a)const noexcept{
12930 const auto this_equlv = this->equal_level();
12931 const auto arg_equlv = a->equal_level();
12932 if(this_equlv _small_than_ arg_equlv)
12933 return a->equal_with(this);
12934 elseif(this_equlv _big_than_ arg_equlv)
12935 return this->equal_with(a);
12936 else
12937 return this->equal_with(a)&&a->equal_with(this);
12938 }
12939
12940 [[nodiscard]]ptr operator&()noexcept{return this;}
12941 [[nodiscard]]const_ptr operator&()const noexcept{return this;}
12942 [[nodiscard]]logical_bool operator==(const this_t&a)const noexcept{
12943 return a.equal(this);
12944 }
12945 protected:
12946 friend void the_waiting_for_destroy(node_like* a)noexcept;
12947 virtual void waiting_for_destroy()noexcept{clear();}
12948 };
12949
12950 //base中的类型功能适应器
12951 [[nodiscard]]inline constexpr node_like*the_get_null_ptr(const node_like*)noexcept;//{return&void;}
12952 [[nodiscard]]inline logical_bool the_pointer_to_bool(const node_like*a)noexcept{
12953 return a->operator logical_bool();
12954 }
12955 [[nodiscard]]inline logical_bool the_pointer_equal(const node_like*a,const node_like*b)noexcept{
12956 return a->eq(b);
12957 }
12958 [[nodiscard]]inline hash_t the_pointer_hash(const node_like*a)noexcept{
12959 return a->operator hash_t();
12960 }
12961 //ptr中的类型功能适应器
12962 inline void the_waiting_for_destroy(node_like*a)noexcept{
12963 a->waiting_for_destroy();
12964 }
12965 inline void the_destroy_and_free(node_like*a)noexcept{
12966 unget(a);
12967 }
12968
12969 //gc中的类型功能适应器
12970 inline void the_destroy(node_like*a)noexcept{
12971 a->destroy();
12972 }
12973
12974 //file_end
12975
12976 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/base_def/_body.hpp"
12977 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/base_def/ptr.hpp"
12978 //def.hpp
12979 //at namespace elc::defs::core
12980 /*
12981 未完成的elc解释器core文件
12982 由steve02081504与Alex0125设计、编写
12983 转载时请在不对此文件做任何修改的同时注明出处
12984 项目地址:https://github.com/steve02081504/ELC
12985 */
12986 typedef comn_ptr_t<node_like>ptr;
12987 typedef weak_ptr_t<node_like>weak_ptr;
12988 typedef comn_ptr_t<const node_like>const_ptr;
12989 typedef weak_ptr_t<const node_like>const_weak_ptr;
12990
12991 //file_end
12992
12993 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/base_def/_body.hpp"
12994 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/base_def/value.hpp"
12995 //value.hpp
12996 //at namespace elc::defs::core
12997 /*
12998 未完成的elc解释器core文件
12999 由steve02081504与Alex0125设计、编写
13000 转载时请在不对此文件做任何修改的同时注明出处
13001 项目地址:https://github.com/steve02081504/ELC
13002 */
13004 typedef value this_t;
13006 with_common_attribute<abstract_base,ref_able,never_in_array,replace_able>,
13008 /*//COMMIT:
13009 是否应当支持value data的引用计数?
13010 否的原因:
13011 这将导致应当对value的data加入gc机制(否则容易出现闭环value垃圾!)
13012 而这将严重增加elc的运行时时空负担
13013 有人可能得到递归引用的value
13014 是的原因:
13015 防御式编程
13016 更佳多样的value实现
13017 引用计数以降低value的复制开销
13018 对否定想法的驳回:
13019 严重增加elc的运行时时空负担?:value的复制开销可能更大
13020 有人可能得到递归引用的value?这将导致应当对value的data加入gc机制?:
13021 没见哪个语言不允许写while(true)
13022 自定义value的应该都是聪明人,如果真的会出现循环引用那他们自己解决就好
13023 总结:
13024 加引用计数,但不加gc
13025 elc的设计理念包括“不应禁止用户做什么”,所以应当提供高自由度的value定制可能
13026 但出于性能考虑,不加gc
13027 如果真的有需要gc解决的value data那么让那聪明的设计者自己给自己的data类加gc解决这种问题就好
13028 */
13029 base_data_t()noexcept=default;
13030 base_data_t(never_ref_num_zero_t)noexcept{ attribute_ptr_cast<ref_able>(this)->init_never_ref_num_zero(); }
13031 virtual ~base_data_t()noexcept=default;
13032
13033 virtual void be_set(ptr)=0;
13034 [[nodiscard]]virtual ptr get_value()=0;
13035 [[nodiscard]]virtual base_data_t*copy()const noexcept=0;
13036 [[nodiscard]]virtual base_type_info_t get_type_info()const noexcept=0;//为什么要加这个?我不知道,万一将来有人用上了呢?
13037 };
13038
13039 distinctive inline static struct null_data_t final:instance_struct<null_data_t>
13041 null_data_t()noexcept:value::base_data_t(never_ref_num_zero){}
13042 virtual ~null_data_t()noexcept override final=default;
13043
13044 virtual void be_set(ptr a)noexcept override final{}
13045 [[nodiscard]]virtual ptr get_value()noexcept override final{return null_ptr;}
13046 [[nodiscard]]virtual base_data_t*copy()const noexcept override final{return remove_const(this);}
13047 [[nodiscard]]virtual base_type_info_t get_type_info()const noexcept override final{return type_info<null_data_t>;}
13048 }null_data{};
13049
13050 struct constexpr_data_t final:instance_struct<constexpr_data_t>
13051 ,base_data_t{
13053 constexpr_data_t(ptr a)noexcept:_m(a){}
13054 constexpr_data_t(const constexpr_data_t&)noexcept=default;
13055 virtual ~constexpr_data_t()noexcept override final=default;
13056
13057 virtual void be_set(ptr)noexcept override final{}
13058 [[nodiscard]]virtual ptr get_value()noexcept override final{return _m;}
13059 [[nodiscard]]virtual base_data_t*copy()const noexcept override final{return get<constexpr_data_t>(_m);}
13060 [[nodiscard]]virtual base_type_info_t get_type_info()const noexcept override final{return type_info<constexpr_data_t>;}
13061 };
13062
13063 struct variable_data_t final:instance_struct<variable_data_t>
13064 ,base_data_t{
13066 variable_data_t(ptr a)noexcept:_m(a){}
13067 variable_data_t(const variable_data_t&)noexcept=default;
13068 virtual ~variable_data_t()noexcept override final=default;
13069
13070 virtual void be_set(ptr a)noexcept override final{_m=a;}
13071 [[nodiscard]]virtual ptr get_value()noexcept override final{return _m;}
13072 [[nodiscard]]virtual base_data_t*copy()const noexcept override final{return get<variable_data_t>(_m);}
13073 [[nodiscard]]virtual base_type_info_t get_type_info()const noexcept override final{return type_info<variable_data_t>;}
13074 };
13075 private:
13076 mutable comn_ptr_t<base_data_t> _m;
13077 public:
13078 explicit value()noexcept:_m(get<variable_data_t>(null_ptr)){}
13079 constexpr explicit value(special_init_t)noexcept:_m(null_ptr){}
13080 explicit value(ptr a)noexcept:_m(get<constexpr_data_t>(a)){}
13081 explicit value(node_like* a)noexcept:value(ptr(a)){}
13082 value(base_data_t*a)noexcept:_m(a){}
13083
13084 value(const this_t&a)noexcept=default;
13085 value(this_t&&a)noexcept=default;
13086 ~value()noexcept=default;
13087
13088 this_t&operator=(ptr a){
13089 _m->be_set(a);
13090 return *this;
13091 }
13093 return operator=(as_ptr(a));
13094 }
13095
13096 [[nodiscard]]operator ptr(){
13097 return _m->get_value();
13098 }
13099 [[nodiscard]]operator const_ptr()const{
13100 return _m->get_value();
13101 }
13102 [[nodiscard]]ptr operator&(){
13103 return operator ptr();
13104 }
13105 [[nodiscard]]const_ptr operator&()const{
13106 return operator const_ptr();
13107 }
13108 [[nodiscard]]explicit operator bool()const{return bool(_m->get_value());}
13109
13110 void ref_to(this_t a)noexcept{
13111 _m.do_replace(a._m);
13112 }
13113 void un_ref()noexcept{
13114 _m=_m->copy();
13115 }
13116 void re_ref_to(this_t a)noexcept{
13117 _m=a._m;
13118 }
13120 a.ref_to(*this);
13121 return*this;
13122 }
13123
13124 template<typename T>
13125 [[nodiscard]]auto operator[](T&&index){
13126 return (*operator&())[forward<T>(index)];
13127 }
13128 template<typename...Args> requires(invoke<node_like>.able<Args...>)
13129 inline auto operator()(Args&&... rest)noexcept(invoke<node_like>.nothrow<Args...>){return(*operator&())(forward<Args>(rest)...);}
13130 [[nodiscard]]auto operator==(auto&&a)const noexcept{
13131 try{
13132 return const_ptr(*this) == const_ptr(as_value(a));
13133 }
13134 catch(...){
13135 return unknown;
13136 }
13137 }
13138 [[nodiscard]]auto operator!=(auto&&a)const{
13139 return !operator==(a);
13140 }
13141 [[nodiscard]]operator ptr::for_delete_t*(){
13142 return _m->get_value();
13143 }
13144 };
13145
13146 static value::base_data_t*the_get_null_ptr(const value::base_data_t*)noexcept{
13147 return&value::null_data;
13148 }
13149
13151
13152 INTER_NAMESPACE(base)
13153 template<>
13154 distinctive inline core::value const_default_value_of<core::value>{special_init};
13156
13157 INTER_NAMESPACE(core)
13158
13159 //file_end
13160
13161 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/base_def/_body.hpp"
13162
13163 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/base_def/node_like_using_value_func_defs.hpp"
13164 //defs.hpp
13165 //at namespace elc::defs::core
13166 /*
13167 未完成的elc解释器core文件
13168 由steve02081504与Alex0125设计、编写
13169 转载时请在不对此文件做任何修改的同时注明出处
13170 项目地址:https://github.com/steve02081504/ELC
13171 */
13172 push_and_disable_msvc_warning(26440);//nothrow警告diss
13173 [[nodiscard]]inline value node_like::be_eval(){
13174 return value(this);
13175 }
13176 [[nodiscard]]inline value node_like::be_call(ptr){
13177 return value(this);
13178 }
13180
13181 [[nodiscard]]inline value node_like::operator[](const value index){
13182 return arec(index);
13183 }
13184
13185 //file_end
13186
13187 #line 15 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/base_def/_body.hpp"
13188
13189 //file_end
13190
13191 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/_body.hpp"
13192 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/runtime_exception/_body.hpp"
13193 //_body.hpp
13194 //at namespace elc::defs::base
13195 /*
13196 未完成的elc解释器base文件
13197 由steve02081504与Alex0125设计、编写
13198 转载时请在不对此文件做任何修改的同时注明出处
13199 项目地址:https://github.com/steve02081504/ELC
13200 */
13201 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/runtime_exception/base_runtime_exception.hpp"
13202 //base_runtime_exception.hpp
13203 //at namespace elc::defs::base
13204 /*
13205 未完成的elc解释器base文件
13206 由steve02081504与Alex0125设计、编写
13207 转载时请在不对此文件做任何修改的同时注明出处
13208 项目地址:https://github.com/steve02081504/ELC
13209 */
13210 struct base_runtime_exception:runtime_exception{
13211 using runtime_exception::runtime_exception;
13212 };
13213
13214 //file_end
13215
13216 #line 9 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/runtime_exception/_body.hpp"
13217 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/runtime_exception/core_runtime_internal_helper.hpp"
13218 //_body.hpp
13219 //at namespace elc::defs::base
13220 /*
13221 未完成的elc解释器base文件
13222 由steve02081504与Alex0125设计、编写
13223 转载时请在不对此文件做任何修改的同时注明出处
13224 项目地址:https://github.com/steve02081504/ELC
13225 */
13226 namespace core_runtime_internal_helper_n{
13228 using base_runtime_exception::base_runtime_exception;
13229 constexpr base_t()noexcept:
13230 base_runtime_exception(locale::str::exception::core_runtime_internal_helper_leak){}
13231 };
13232 //
13235 };
13237 }
13238 //#include ".hpp"
13239
13240 //file_end
13241
13242 #line 10 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/runtime_exception/_body.hpp"
13243
13244 //file_end
13245
13246 #line 17 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/_body.hpp"
13247 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/special_values/_body.hpp"
13248 //_body.hpp
13249 //at namespace elc::defs::base
13250 /*
13251 未完成的elc解释器base文件
13252 由steve02081504与Alex0125设计、编写
13253 转载时请在不对此文件做任何修改的同时注明出处
13254 项目地址:https://github.com/steve02081504/ELC
13255 */
13256 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/special_values/base_constexpr.hpp"
13257 //base_constexpr.hpp
13258 //at namespace elc::defs::core
13259 /*
13260 未完成的elc解释器base文件
13261 由steve02081504与Alex0125设计、编写
13262 转载时请在不对此文件做任何修改的同时注明出处
13263 项目地址:https://github.com/steve02081504/ELC
13264 */
13265 struct base_constexpr_t:node_like,instance_struct<base_constexpr_t>{
13266 [[nodiscard]]virtual base_type_info_t get_type_info()const noexcept override{return type_info<base_constexpr_t>;}
13267 protected:
13268 [[nodiscard]]virtual constexpr size_t equal_level()const noexcept override{return magic_number::god;}
13269 [[nodiscard]]virtual constexpr size_t eq_level()const noexcept override{return magic_number::god;}
13270 public:
13271 base_constexpr_t()noexcept:node_like(never_ref_num_zero){}
13272 constexpr virtual ~base_constexpr_t()noexcept override=default;
13273
13274 [[nodiscard]]virtual value arec(const value)noexcept override{return value(this);}
13275
13276 virtual void clear()noexcept override final{nothing}
13277
13278 virtual void be_replace_as(ptr)noexcept override{nothing}
13279 };
13280
13281 //file_end
13282
13283 #line 9 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/special_values/_body.hpp"
13284 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/special_values/void.hpp"
13285 //void.hpp
13286 //at namespace elc::defs::core
13287 /*
13288 未完成的elc解释器base文件
13289 由steve02081504与Alex0125设计、编写
13290 转载时请在不对此文件做任何修改的同时注明出处
13291 项目地址:https://github.com/steve02081504/ELC
13292 */
13293 /*
13294 使用elc::the_void来访问此值
13295 或者通过包含<elc/void_name>来使用elc::void访问此值,并使用::void来访问c艹的原生void
13296 */
13298 [[nodiscard]]virtual base_type_info_t get_type_info()const noexcept override{return type_info<void_t>;}
13299 protected:
13300 [[nodiscard]]virtual constexpr size_t equal_level()const noexcept override{return max(type_info<size_t>);}
13301 [[nodiscard]]virtual constexpr size_t eq_level()const noexcept override{return max(type_info<size_t>);}
13302 [[nodiscard]]virtual logical_bool equal_with(const_ptr a)const noexcept override{
13303 if(this==a)
13304 return either;//当void是void时,void不是void
13305 else
13306 return neither;//当a不是void时,void是a
13307 }
13308 //我不知道为什么这么写,反正很有趣
13309 public:
13310 [[nodiscard]]virtual constexpr explicit operator hash_t()const noexcept override{return hash(nothing);}
13311 [[nodiscard]]virtual constexpr explicit operator logical_bool()const noexcept override{return neither;}//void 应当不真不假
13313
13314 [[nodiscard]]constexpr node_like*the_get_null_ptr(const node_like*)noexcept{return addressof((node_like&)the_void);}
13315
13316 //file_end
13317
13318 #line 10 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/special_values/_body.hpp"
13319 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/special_values/nil.hpp"
13320 //nil.hpp
13321 //at namespace elc::defs::core
13322 /*
13323 未完成的elc解释器base文件
13324 由steve02081504与Alex0125设计、编写
13325 转载时请在不对此文件做任何修改的同时注明出处
13326 项目地址:https://github.com/steve02081504/ELC
13327 */
13329 [[nodiscard]]virtual base_type_info_t get_type_info()const noexcept override{return type_info<nil_t>;}
13330 protected:
13331 [[nodiscard]]virtual logical_bool equal_with(const_ptr a)const noexcept override{return !logical_bool(a);}
13332 public:
13333 [[nodiscard]]virtual constexpr explicit operator hash_t()const noexcept override{return hash(false);}
13334 [[nodiscard]]virtual constexpr explicit operator logical_bool()const noexcept override{return false;}
13335 }nil{};
13336
13337 //file_end
13338
13339 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/special_values/_body.hpp"
13340 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/special_values/t.hpp"
13341 //t.hpp
13342 //at namespace elc::defs::core
13343 /*
13344 未完成的elc解释器base文件
13345 由steve02081504与Alex0125设计、编写
13346 转载时请在不对此文件做任何修改的同时注明出处
13347 项目地址:https://github.com/steve02081504/ELC
13348 */
13349 distinctive inline struct t_t final:base_constexpr_t{
13350 [[nodiscard]]virtual base_type_info_t get_type_info()const noexcept override{return type_info<t_t>;}
13351 protected:
13352 [[nodiscard]]virtual logical_bool equal_with(const_ptr a)const noexcept override{return logical_bool(a);}
13353 public:
13354 [[nodiscard]]virtual constexpr explicit operator hash_t()const noexcept override{return hash(true);}
13355 [[nodiscard]]virtual constexpr explicit operator logical_bool()const noexcept override{return true;}
13356
13357 //nothing is true,everything is permitted.
13358 [[noreturn]]virtual void be_replace_as(ptr)noexcept override{::std::exit(0);}
13359 }t{};
13360
13361 //file_end
13362
13363 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/special_values/_body.hpp"
13364
13365 //file_end
13366
13367 #line 18 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/_body.hpp"
13368 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/nodes/_body.hpp"
13369 //_body.hpp
13370 //at namespace elc::defs::core
13371 /*
13372 未完成的elc解释器core文件
13373 由steve02081504与Alex0125设计、编写
13374 转载时请在不对此文件做任何修改的同时注明出处
13375 项目地址:https://github.com/steve02081504/ELC
13376 */
13377 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/nodes/common_node.hpp"
13378 //common_node.hpp
13379 //at namespace elc::defs::core
13380 /*
13381 未完成的elc解释器core文件
13382 由steve02081504与Alex0125设计、编写
13383 转载时请在不对此文件做任何修改的同时注明出处
13384 项目地址:https://github.com/steve02081504/ELC
13385 */
13386 struct common_node:node_like,instance_struct<common_node>{
13388
13389 map_t<value,const_weak_ptr> _m;
13390
13391 [[nodiscard]]virtual base_type_info_t get_type_info()const noexcept override{return type_info<this_t>;}
13392 protected:
13393 [[nodiscard]]virtual logical_bool equal_with(const_ptr a)const noexcept override{
13394 if(a->get_type_info() != this->get_type_info())
13395 return false;
13396 const this_t*p=down_cast<const this_t*>(a.get());
13397 return _m==p->_m;
13398 }
13399 public:
13400 [[nodiscard]]virtual value arec(const value index)override{return _m[&index];}
13401
13402 virtual void clear()noexcept override{_m.clear();}
13403 };
13404
13405 //file_end
13406
13407 #line 9 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/nodes/_body.hpp"
13408 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/nodes/cons.hpp"
13409 //common_node.hpp
13410 //at namespace elc::defs::core
13411 /*
13412 未完成的elc解释器core文件
13413 由steve02081504与Alex0125设计、编写
13414 转载时请在不对此文件做任何修改的同时注明出处
13415 项目地址:https://github.com/steve02081504/ELC
13416 */
13417 inline value car_of(ptr p){
13418 return (*p)[t];
13419 }
13420 inline value cdr_of(ptr p){
13421 return (*p)[nil];
13422 }
13423 inline value car_of(auto&&node){
13424 return car_of(as_ptr(node));
13425 }
13426 inline value cdr_of(auto&&node){
13427 return cdr_of(as_ptr(node));
13428 }
13429
13430 struct cons:node_like,instance_struct<cons>{
13431 typedef cons this_t;
13432
13435
13436 cons(ptr car,ptr cdr){
13437 _car = car;
13438 _cdr = cdr;
13439 }
13440
13441 [[nodiscard]]virtual base_type_info_t get_type_info()const noexcept override{return type_info<cons>;}
13442 protected:
13443 [[nodiscard]]virtual logical_bool equal_with(const_ptr a)const noexcept override{
13444 if(a->get_type_info() != this->get_type_info())
13445 return false;
13446 const this_t*p=down_cast<const this_t*>(a.get());
13447 return _car==p->_car&&_cdr==p->_cdr;
13448 }
13449 public:
13450 [[nodiscard]]virtual value arec(const value index)override{
13451 const_ptr v=index;
13452 if(v==&nil)
13453 return _cdr;
13454 elseif(v==&t)
13455 return _car;
13456 else{
13457 ptr to=get<common_node>();
13458 _car >> car_of(to);
13459 _cdr >> cdr_of(to);
13460 be_replace_as(to);
13461 return (*to)[v];
13462 }
13463 }
13464
13465 virtual void clear()noexcept override{as_value(&the_void)>>_car>>_cdr;}
13466 };
13467
13468 [[nodiscard]]inline ptr make_list()noexcept{return &nil;}
13469 template<typename T,typename...Args>
13470 [[nodiscard]]inline ptr make_list(T&&first,Args&&...rest){
13471 ELC_TEST_EVENTNAME("make_list调用");
13472 return get<cons>(as_ptr(first),make_list(forward<Args>(rest)...));
13473 }
13474
13475 //file_end
13476
13477 #line 10 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/nodes/_body.hpp"
13478 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/nodes/expr.hpp"
13479 //expr.hpp
13480 //at namespace elc::defs::core
13481 /*
13482 未完成的elc解释器core文件
13483 由steve02081504与Alex0125设计、编写
13484 转载时请在不对此文件做任何修改的同时注明出处
13485 项目地址:https://github.com/steve02081504/ELC
13486 */
13487 struct expr:cons,instance_struct<expr>{
13488 typedef expr this_t;
13490 public:
13491 using cons::_car;
13492 using cons::_cdr;
13493 using cons::cons;
13494
13495 [[nodiscard]]virtual value be_eval()override{
13496 return as_ptr(_car)->be_call(_cdr);
13497 }
13498 [[nodiscard]]virtual base_type_info_t get_type_info()const noexcept override{return type_info<expr>;}
13499 };
13500
13501 //file_end
13502
13503 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/nodes/_body.hpp"
13504 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/nodes/base_binary_function_node.hpp"
13505 //base_binary_function_node.hpp
13506 //at namespace elc::defs::core
13507 /*
13508 未完成的elc解释器core文件
13509 由steve02081504与Alex0125设计、编写
13510 转载时请在不对此文件做任何修改的同时注明出处
13511 项目地址:https://github.com/steve02081504/ELC
13512 */
13513 struct base_binary_function_node:node_like,instance_struct<base_binary_function_node>{
13515
13516 function_t<value(ptr)> _func;
13517
13518 base_binary_function_node(function_t<value(ptr)> func)noexcept:_func(func){}
13519 base_binary_function_node(function_t<void(ptr)> func)noexcept{
13520 _func = lambda_with_catch(func)(ptr p)mutable{
13521 func(p);
13522 return as_value(the_void);
13523 };
13524 }
13525 base_binary_function_node(function_t<void()> func)noexcept{
13526 _func = lambda_with_catch(func)(ptr)mutable{
13527 func();
13528 return as_value(the_void);
13529 };
13530 }
13531
13532 [[nodiscard]]virtual base_type_info_t get_type_info()const noexcept override{return type_info<this_t>;}
13533 [[nodiscard]]virtual value be_call(ptr arg_list)override{return _func(arg_list);}
13534 protected:
13535 [[nodiscard]]virtual logical_bool equal_with(const_ptr a)const noexcept override{
13536 if(a->get_type_info() != this->get_type_info())
13537 return false;
13538 const this_t*p=down_cast<const this_t*>(a.get());
13539 try{
13540 return _func==p->_func;
13541 }
13542 catch(...){
13543 return unknown;
13544 }
13545 }
13546 public:
13547 [[nodiscard]]virtual value arec(const value index)override{return the_void[index];}
13548
13549 virtual void clear()noexcept override{_func=nullptr;}
13550 };
13551
13552 //file_end
13553
13554 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/nodes/_body.hpp"
13555 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/nodes/binary_node_t.hpp"
13556 //binary_node_t.hpp
13557 //at namespace elc::defs::core
13558 /*
13559 未完成的elc解释器core文件
13560 由steve02081504与Alex0125设计、编写
13561 转载时请在不对此文件做任何修改的同时注明出处
13562 项目地址:https://github.com/steve02081504/ELC
13563 */
13566
13567 [[nodiscard]]virtual base_type_info_t get_type_info()const noexcept override final{return type_info<this_t>;}
13568 [[nodiscard]]virtual base_type_info_t get_additional_type_info()const noexcept=0;
13569 protected:
13570 [[noreturn]] virtual void throw_self_ptr()const=0;
13571 [[noreturn]] virtual void throw_self_ptr()=0;
13572 template<typename T>
13573 friend[[nodiscard]]inline maybe_fail_reference<T> maybe_fail_use_by_ref_as(ptr p)noexcept;
13574 template<typename T>
13575 friend[[nodiscard]]inline maybe_fail_reference<T> maybe_fail_use_by_ref_as(ptr p)noexcept;
13576 template<typename T>
13577 friend[[nodiscard]]inline const T& const_use_by_ref_as(const_ptr p)noexcept;
13578 };
13579 template<typename T>
13583
13585
13586 binary_node_t(const T&a)noexcept:_m(a){}
13587 binary_node_t(T&&a)noexcept:_m(a){}
13588
13589 [[nodiscard]]virtual base_type_info_t get_additional_type_info()const noexcept override{return type_info<this_t>;}
13590 private:
13591 static constexpr bool hash_nothrow_helper=hash.able<T>?
13592 hash.nothrow<T>:1;
13593 public:
13594 [[nodiscard]]virtual explicit operator hash_t()const noexcept(hash_nothrow_helper)override{
13595 if constexpr(hash.able<T>)
13596 return hash(_m);
13597 else
13598 #if defined(_MSC_VER)
13599 [[gsl::suppress(f.6)]]
13600 #endif
13601 return node_like::operator hash_t();
13602 }
13603 protected:
13604 [[noreturn]] virtual void throw_self_ptr()const override{throw&_m;}
13605 [[noreturn]] virtual void throw_self_ptr()override{throw&_m;}
13606 [[nodiscard]]virtual logical_bool eq_with(const_ptr a)const noexcept override{
13607 using defs::equal;//貌似msvc在这里有bug
13608 if constexpr(equal.able<T>){
13609 if(a->get_type_info() != this->get_type_info())
13610 return false;
13611 const base_t*base_p=down_cast<const base_t*>(a.get());
13612 if(base_p->get_type_info() != this->get_type_info())
13613 return false;
13614 const this_t*p=down_cast<const this_t*>(base_p);
13615 return _m==p->_m;
13616 }
13617 else
13618 return node_like::eq_with(a);
13619 }
13620 [[nodiscard]]virtual logical_bool equal_with(const_ptr a)const noexcept override{
13621 return eq_with(a);
13622 }
13623 private:
13624 static constexpr bool arec_nothrow_helper=was_not_an_ill_form(arec_as_value(_m,declvalue(const value&)))?
13625 was_not_an_ill_form_and_noexcept(arec_as_value(_m,declvalue(const value&))):1;
13626 public:
13627 [[nodiscard]]virtual value arec(const value index)noexcept(arec_nothrow_helper)override{
13628 if constexpr(was_not_an_ill_form(arec_as_value(_m,index)))
13629 return arec_as_value(_m,index);
13630 else
13631 return as_value(this);
13632 }
13633 private:
13634 static constexpr bool clear_nothrow_helper= was_not_an_ill_form(declvalue(T).clear())?
13636 re_construct.nothrow<T>;
13637 public:
13638 virtual void clear()noexcept(clear_nothrow_helper)override{
13639 if constexpr(was_not_an_ill_form(declvalue(T).clear()))
13640 _m.clear();
13641 else
13642 re_construct(&_m);
13643 }
13644 };
13645
13646 template<typename T>
13647 [[nodiscard]]inline bool was_an(const_ptr p)noexcept{
13648 typedef binary_node_t<T> target_node_t;
13649 if(p->get_type_info() == type_info<binary_node_base_t>){
13650 auto base_p = down_cast<const binary_node_base_t*>(p.get());
13651 if(base_p->get_additional_type_info() == type_info<target_node_t>)
13652 return true;
13653 elseif constexpr(::std::is_class_v<T> && !::std::is_final_v<T>){
13654 try{
13655 base_p->throw_self_ptr();
13656 }
13657 catch(const T*){
13658 return true;
13659 }
13660 catch(const void*){}
13661 }
13662 }
13663 return false;
13664 }
13665 template<typename T>
13667 typedef binary_node_t<T> target_node_t;
13668 if(p->get_type_info() == type_info<binary_node_base_t>){
13669 auto base_p = down_cast<binary_node_base_t*>(p.get());
13670 if(base_p->get_additional_type_info() == type_info<target_node_t>)
13671 return down_cast<target_node_t*>(base_p)->_m;
13672 elseif constexpr(::std::is_class_v<T> && !::std::is_final_v<T>){
13673 try{
13674 base_p->throw_self_ptr();
13675 }
13676 catch(T*aret){
13677 return*aret;
13678 }
13679 catch(void*){}
13680 }
13681 }
13682 return note::fail;
13683 }
13684 template<typename T>
13685 [[nodiscard]]inline T& use_by_ref_as(ptr p)noexcept{
13686 return maybe_fail_use_by_ref_as<T>(p).get_ref();
13687 }
13688 template<typename T>
13689 [[nodiscard]]inline const T& const_use_by_ref_as(const_ptr p)noexcept{
13690 typedef binary_node_t<T> target_node_t;
13691 if(p->get_type_info() == type_info<binary_node_base_t>){
13692 auto base_p = down_cast<const binary_node_base_t*>(p.get());
13693 if(base_p->get_additional_type_info() == type_info<target_node_t>)
13694 return down_cast<const target_node_t*>(base_p)->_m;
13695 elseif constexpr(::std::is_class_v<T> && !::std::is_final_v<T>){
13696 try{
13697 base_p->throw_self_ptr();
13698 }
13699 catch(const T*aret){
13700 return*aret;
13701 }
13702 catch(const void*){}
13703 }
13704 }
13705 return const_default_value_of<T>;
13706 }
13707 template<typename T>
13708 [[nodiscard]]inline T use_as(const_ptr p)noexcept{
13709 return const_use_by_ref_as<T>(p);
13710 }
13711 template<typename T>
13712 [[nodiscard]]inline const T& use_by_ref_as(const_ptr p)noexcept{
13713 return const_use_by_ref_as<T>(p);
13714 }
13715 template<typename T>
13716 [[nodiscard]]inline const T& use_by_ref_as(auto&&a)noexcept{
13717 return use_by_ref_as<T>(as_ptr(a));
13718 }
13719 template<typename T>
13720 [[nodiscard]]inline ptr make_binary_node_from(T a)noexcept{
13721 return get<binary_node_t<T>>(move(a));
13722 }
13723 template<typename T>
13725 template<typename T>
13726 [[nodiscard]]inline ptr make_long_term_binary_node_from(T a)noexcept{
13727 ptr& to = long_term_binary_node_storager<T>[a];
13728 if(!bool(to) || const_use_by_ref_as<T>(to)!=a)
13729 to = make_binary_node_from<T>(move(a));
13730 return to;
13731 }
13732
13733 //file_end
13734
13735 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/nodes/_body.hpp"
13736 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/nodes/code_list.hpp"
13737 //code_list.hpp
13738 //at namespace elc::defs::core
13739 /*
13740 未完成的elc解释器core文件
13741 由steve02081504与Alex0125设计、编写
13742 转载时请在不对此文件做任何修改的同时注明出处
13743 项目地址:https://github.com/steve02081504/ELC
13744 */
13745 inline value eval(ptr p){
13746 return p->be_eval();
13747 }
13748 inline value eval(auto&&node){
13749 return eval(as_ptr(node));
13750 }
13751 struct code_list:cons,instance_struct<code_list>{
13754 public:
13755 using cons::cons;
13756
13757 [[nodiscard]]virtual value be_eval()override{
13758 ptr self = this;
13759 value aret{special_init};
13760 from_goto:
13761 try{
13762 do{
13763 eval(car_of(self)) >> aret;
13764 self=cdr_of(self);
13765 }while(self);
13766 }
13768 self=info.to;
13769 goto from_goto;
13770 }
13772 }
13773 return aret;
13774 }
13775 [[nodiscard]]virtual base_type_info_t get_type_info()const noexcept override{return type_info<code_list>;}
13776 };
13777
13778 //file_end
13779
13780 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/nodes/_body.hpp"
13781
13782 //file_end
13783
13784 #line 19 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/_body.hpp"
13785 }
13786
13787 #if defined(ELC_TEST_ON)
13788 namespace core_part_test{
13789 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/_test.hpp"
13790 //_test.hpp
13791 /*
13792 未完成的elc解释器core文件
13793 由steve02081504与Alex0125设计、编写
13794 转载时请在不对此文件做任何修改的同时注明出处
13795 项目地址:https://github.com/steve02081504/ELC
13796 */
13797 inline void test(){
13798 ELC_TEST_EVENTNAME("core部分测试");
13799 }
13800 inline void test_log_out(){
13801 }
13802 inline void test_end(){
13803 }
13804
13805 //file_end
13806
13807 #line 24 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/_body.hpp"
13808 }
13809 #endif
13810
13811 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
13812 //_undefs.hpp
13813 /*
13814 未完成的elc解释器basic文件
13815 由steve02081504与Alex0125设计、编写
13816 转载时请在不对此文件做任何修改的同时注明出处
13817 项目地址:https://github.com/steve02081504/ELC
13818 */
13819 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_undefs.hpp"
13820 //_undefs.hpp
13821 /*
13822 未完成的elc解释器_share文件
13823 由steve02081504与Alex0125设计、编写
13824 转载时请在不对此文件做任何修改的同时注明出处
13825 项目地址:https://github.com/steve02081504/ELC
13826 */
13827
13828 //defs at "_defs.hpp"
13829
13830 #if defined(_MSC_VER)
13831 #pragma warning(pop)
13832 #endif
13833 #undef suppress_msvc_warning
13834 #undef disable_msvc_warning
13835 #undef push_msvc_warning
13836 #undef pop_msvc_warning
13837 #undef push_and_disable_msvc_warning
13838
13839 //for basic_environment.hpp
13840 #undef BIT_POSSIBILITY
13841 //
13842 #if defined(ELC_VOID_NAME)
13843 #define void the_void
13844 #endif
13845
13846 // #undef often_noexcept
13847 #undef noexcept_as
13848 #undef noexcept_as_auto
13849 #undef constexpr_as
13850 #undef constexpr_as_auto
13851
13852 #undef using_method_from_base_t
13853 #undef using_method_from_value
13854
13855 #undef floop
13856 #undef enable_adl
13857
13858 #undef re_declvalue
13859 #undef re_decltype
13860
13861 #undef declvalue
13862
13863 #undef template_error
13864 #undef template_warning
13865
13866 #undef type_info_of
13867 #undef type_name_of
13868
13869 #undef is_common_attribute
13870 #undef is_special_attribute
13871
13872 #undef has_attribute
13873 #undef not_has_attribute
13874
13875 #undef float_size_of
13876 #undef bitnum_of
13877
13878 #undef def_common_attribute_with_nothing
13879 #undef def_special_attribute_with_nothing
13880
13881 #undef common_attribute_t
13882 #undef special_attribute_t
13883
13884 #undef enable_if
13885 #undef enabled_by_default
13886 #undef disabled_by_default
13887 #undef enable_if_not_ill_form
13888 #undef enable_flag
13889
13890 #undef was_an_ill_form
13891 #undef was_an_ill_form_with_parameter
13892 #undef was_not_an_ill_form
13893 #undef was_not_an_ill_form_and_noexcept
13894 #undef was_not_an_ill_form_with_parameter
13895
13896 #undef recursive_lambda
13897 #undef get_recursive_lambda_caller
13898 #undef lambda
13899 #undef lambda_with_catch
13900 #undef self_recursion
13901 #undef lambda_RLSRRS
13902
13903 #undef MAGIC
13904
13905 #undef nothing
13906
13907 #undef elseif
13908 #undef _big_than_
13909 #undef _small_than_
13910
13911 #if defined(_MSC_VER)
13912 #undef not
13913 #undef and
13914 #undef or
13915 #endif
13916
13917 #undef INTER_NAMESPACE
13918 #undef BREAK_NAMESPACE
13919
13920 #undef szie
13921 #undef form
13922
13923 #undef template_name
13924 #undef type_name
13925
13926 #undef not_in_debug
13927
13928 #undef es
13929 #undef ec
13930
13931 #undef ELC_TEST_EVENTNAME
13932
13933 #undef override_instance_struct
13934
13935 #undef distinctive
13936
13937 #undef force_inline
13938
13939 #undef with_no_vtable
13940
13941 #undef in_consteval
13942
13943 #undef no_vtable_struct
13944 #undef no_vtable_class
13945
13946 //file_end
13947
13948 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
13949
13950 //file_end
13951
13952 #line 28 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/_body.hpp"
13953 }
13954 namespace elc{
13955 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/_export.hpp"
13956 //_export.hpp
13957 //at namespace elc
13958 /*
13959 未完成的elc解释器core文件
13960 由steve02081504与Alex0125设计、编写
13961 转载时请在不对此文件做任何修改的同时注明出处
13962 项目地址:https://github.com/steve02081504/ELC
13963 */
13964 #define export using defs::core::
13965 export node_like;
13966 export ptr;
13970 export value;
13971
13972 export nil;
13973 export t;
13975
13977 export as_ptr;
13978 export common_node;
13979 #undef export
13980
13981 //file_end
13982
13983 #line 31 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/_body.hpp"
13984 }
13985 #if defined(ELC_STRING)
13986 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_multi/string_arec_as_value.hpp"
13987 //string_arec_as_value.hpp
13988 //at namespace ::
13989 //multi when ELC_STRING & ELC_CORE
13990 /*
13991 未完成的elc解释器string文件
13992 由steve02081504与Alex0125设计、编写
13993 转载时请在不对此文件做任何修改的同时注明出处
13994 项目地址:https://github.com/steve02081504/ELC
13995 */
13996 namespace elc::defs{
13997 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
13998 //_defs.hpp
13999 /*
14000 未完成的elc解释器basic文件
14001 由steve02081504与Alex0125设计、编写
14002 转载时请在不对此文件做任何修改的同时注明出处
14003 项目地址:https://github.com/steve02081504/ELC
14004 */
14005 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
14006 //_defs.hpp
14007 /*
14008 未完成的elc解释器_share文件
14009 由steve02081504与Alex0125设计、编写
14010 转载时请在不对此文件做任何修改的同时注明出处
14011 项目地址:https://github.com/steve02081504/ELC
14012 */
14013
14014 //undefs at "_undefs.hpp"
14015
14016 //set ELC_WARNING_LEVEL default to 4(max)
14017 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
14018
14019 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/basic_environment.hpp"
14020 //basic_environment.hpp
14021 /*
14022 未完成的elc解释器_share文件
14023 由steve02081504与Alex0125设计、编写
14024 转载时请在不对此文件做任何修改的同时注明出处
14025 项目地址:https://github.com/steve02081504/ELC
14026 */
14027
14030 #define BIT_POSSIBILITY 2
14031
14032 //file_end
14033
14034 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
14035
14036 #if defined(_MSC_VER)
14037 #pragma warning(push,ELC_WARNING_LEVEL)
14038 #pragma warning(disable:4099)//class与struct混用警告diss
14039 #pragma warning(disable:26812)//enum class安利diss.
14040 #pragma warning(disable:4584)//重复子类警告diss
14041 #pragma warning(disable:4250)//域控制继承警告diss
14042 #pragma warning(disable:26432)//不完全默认方法警告diss
14043 #pragma warning(disable:26435)//virtual override方法警告diss
14044 #pragma warning(disable:26481)//容器安利diss
14045 #pragma warning(disable:26446)//gsl::at安利diss
14046 #pragma warning(disable:26434)//方法覆盖警告diss
14047 #pragma warning(disable:26429)//gsl::not_null安利diss
14048 #pragma warning(disable:26471)//对void*进行static_cast安利diss
14049 #pragma warning(disable:26474)//隐式指针转换显式cast警告diss
14050 #pragma warning(disable:26473)//相同指针显式cast警告diss
14051 #pragma warning(disable:26456)//隐藏非虚运算符警告diss
14052 #pragma warning(disable:26485)//数组作指针警告diss
14053 #pragma warning(disable:26490)//reinterpret_cast警告diss
14054 #pragma warning(disable:26472)//static_cast窄幅转换警告diss
14055 #pragma warning(disable:26482)//非常数数组索引警告diss
14056 #pragma warning(disable:26493)//c_cast转换警告diss:虽然有用但是太烦了,爬
14057 #endif
14058 #if defined(_MSC_VER)
14059 #define suppress_msvc_warning(...) __pragma(warning(suppress:__VA_ARGS__))
14060 #define disable_msvc_warning(...) __pragma(warning(disable:__VA_ARGS__))
14061 #define push_msvc_warning() __pragma(warning(push))
14062 #define pop_msvc_warning() __pragma(warning(pop))
14063 #define push_and_disable_msvc_warning(...) push_msvc_warning() disable_msvc_warning(__VA_ARGS__)
14064 #else
14065 #define suppress_msvc_warning(...)
14066 #define disable_msvc_warning(...)
14067 #define push_msvc_warning()
14068 #define pop_msvc_warning()
14069 #define push_and_disable_msvc_warning(...)
14070 #endif
14071 //
14072 #if defined(ELC_VOID_NAME)
14073 #undef void
14074 #endif
14075
14076 // #define often_noexcept
14077 #define noexcept_as(...) noexcept(noexcept((__VA_ARGS__)))//dnmd C艹标准就是没有noexcept_as_auto
14078 #define noexcept_as_auto MAGIC//哦现在有了
14079 #define constexpr_as(...) MAGIC constexpr//( •̀ ω •́ )✌
14080 #define constexpr_as_auto MAGIC MAGIC constexpr//✌( •̀ ω •́ )✌
14081
14082 #define using_method_from_base_t(name,...) \
14083 template<class...Args> requires was_not_an_ill_form(declvalue(base_t).name(declvalue(Args)...))\
14084 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(base_t::name(declvalue(Args)...))\
14085 {\
14086 return base_t::name(forward<Args>(rest)...);\
14087 }\
14088
14089 #define using_method_from_value(name,value_name,...) \
14090 template<class...Args> requires was_not_an_ill_form(re_declvalue(value_name).name(declvalue(Args)...))\
14091 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(re_declvalue(value_name).name(declvalue(Args)...))\
14092 {\
14093 return value_name.name(forward<Args>(rest)...);\
14094 }\
14095
14096 #define floop while(__builtin_is_my_dick_still_there())
14097 #define enable_adl(name) void name()noexcept=delete
14098
14099 #define re_declvalue(...) (declvalue(decltype(__VA_ARGS__)))
14100 #define re_decltype(...) (decltype(declvalue(__VA_ARGS__)))
14101
14102 #define declvalue(...) (::std::declval<__VA_ARGS__>())
14103
14105 #define template_error(reason) static_assert(template_error_helper<T>,reason)
14107 #define template_warning(reason) template_warning_helper<T>(reason)
14108
14109 //for type_info
14110 #define type_info_of(...) base_type_info_t(typeid(__VA_ARGS__))
14111 #define type_name_of(...) (type_info_of(__VA_ARGS__).name())
14112
14113 #define is_common_attribute(name) public attribute<T,name<T>>
14114 #define is_special_attribute(name) public attribute<T,name>
14115
14116 #define has_attribute(...) template_name has_attribute_helper<__VA_ARGS__>()
14117 #define not_has_attribute(...) template_name not_has_has_attribute_helper<__VA_ARGS__>()
14118
14119 //for float_size_t
14120 #define float_size_of(...) (float_size_t{sizeof(__VA_ARGS__)})
14121 //bitnum_of
14122 #define bitnum_of(...) (bitnumof<__VA_ARGS__>)
14123
14124 //for attribute
14125 #define def_common_attribute_with_nothing(name) \
14126 template<typename T>\
14127 class name{}\
14128
14129 #define def_special_attribute_with_nothing(name) \
14130 class name{}\
14131
14132 #define common_attribute_t template<class>class
14133 #define special_attribute_t class
14134
14143 #define enable_if(...) class enable_state= ::std::enable_if_t<__VA_ARGS__>
14145 #define enabled_by_default class enable_state=void
14147 #define disabled_by_default class enable_state= ::std::enable_if_t<false>
14149 #define enable_if_not_ill_form(...) class enable_state= ::std::void_t<decltype(__VA_ARGS__)>
14151 #define enable_flag class enable_state
14152
14153 #define was_an_ill_form(...) (!was_not_an_ill_form(__VA_ARGS__))
14154 #define was_an_ill_form_with_parameter(...) (!was_not_an_ill_form_with_parameter(__VA_ARGS__))
14155 #define was_not_an_ill_form(...) (bool(requires{__VA_ARGS__;}))
14156 #define was_not_an_ill_form_and_noexcept(...) (bool(requires{__VA_ARGS__;{__VA_ARGS__}noexcept;}))
14157 #define was_not_an_ill_form_with_parameter(...) (bool(requires __VA_ARGS__ ))
14158
14160 #define recursive_lambda(...) lambda(auto&&lambda_RLSRRS,__VA_ARGS__)
14162 #define get_recursive_lambda_caller(name) \
14163 lambda_with_catch(&)(auto&&...Args){\
14164 return name(name,Args...);\
14165 }
14167 #define lambda []
14169 #define lambda_with_catch(...) [__VA_ARGS__]
14171 #define self_recursion(...) lambda_RLSRRS(lambda_RLSRRS,__VA_ARGS__)
14172 //recursive_lambda_self_referential_reserved_symbolname
14173 #define lambda_RLSRRS _my_jb_super_sb_name_
14174
14175 #define MAGIC//ahh,ko no tenno da!
14176
14178 #define nothing
14179
14181 #define elseif else if
14183 #define _big_than_ >
14185 #define _small_than_ <
14186
14187 #if defined(_MSC_VER)
14188 #define not !
14189 #define and &&
14190 #define or ||
14191 #endif
14192
14194 #define INTER_NAMESPACE(NAMESPACENAME) namespace NAMESPACENAME{
14196 #define BREAK_NAMESPACE }
14197
14199 #define template_name template
14201 #define type_name class
14202
14203 #if defined(DEBUG) || defined(_DEBUG)
14204 #define not_in_debug 0
14205 #else
14206 #define not_in_debug 1
14207 #endif
14208
14209 #define es U""
14210 #define ec(ch) U ## ch
14211
14212 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
14213 #define ELC_TEST_EVENTNAME(name) stest_eventer _the_stest_eventer__(L""name)
14214 #else
14215 #define ELC_TEST_EVENTNAME(name)
14216 #endif
14217
14218 #define override_instance_struct \
14219 protected:\
14220 virtual void abstract_method_unget_this()noexcept_as(instance_struct<this_t>::abstract_method_unget_this())override{instance_struct<this_t>::abstract_method_unget_this();}\
14221 virtual void* _abstract_method_copy_get_this()noexcept_as(instance_struct<this_t>::_abstract_method_copy_get_this())override{return instance_struct<this_t>::_abstract_method_copy_get_this();}\
14222 virtual void* _abstract_method_get_resize_this(size_t size)noexcept_as(instance_struct<this_t>::instance_struct<this_t>::_abstract_method_get_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_resize_this(size);}\
14223 virtual void* _abstract_method_get_forward_resize_this(size_t size)noexcept_as(instance_struct<this_t>::_abstract_method_get_forward_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_forward_resize_this(size);}\
14224 virtual size_t abstract_method_get_size_of_get_for_this()noexcept override{return instance_struct<this_t>::abstract_method_get_size_of_get_for_this();}
14225
14226 #if defined(_WIN32)
14227 #define distinctive __declspec(dllexport)
14228 #else
14229 #define distinctive
14230 #endif
14231
14232 #if defined(_WIN32)
14233 #define force_inline __forceinline
14234 #elif defined(__GNUC__)
14235 #define force_inline __attribute__((always_inline)) inline
14236 #else
14237 #define force_inline inline
14238 #endif
14239
14240 #if defined(_WIN32)
14241 #define with_no_vtable __declspec(novtable)
14242 #else
14243 #define with_no_vtable
14244 #endif
14245
14246 #define in_consteval (::std::is_constant_evaluated())
14247
14248 #define no_vtable_struct struct with_no_vtable
14249 #define no_vtable_class class with_no_vtable
14250
14251 //file_end
14252
14253 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
14254
14255 //file_end
14256
14257 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_multi/string_arec_as_value.hpp"
14258
14259 namespace string_n{
14260 template<class char_T>
14261 value arec_as_value(string_t<char_T>&str,const value index){
14262 size_t i=size_t(use_as<int_t>(index));
14263 if(!i)
14264 i=size_t(use_as<uint_t>(index));
14265 struct arec_data_t final:instance_struct<arec_data_t>
14266 ,value::base_data_t{
14267 typename string_t<char_T>::arec_t _m;
14268 arec_data_t(string_t<char_T>&str,size_t index)noexcept:_m(&str,index){};
14269 arec_data_t(const arec_data_t&ref)noexcept:_m(special_init,ref._m){}
14270 virtual ~arec_data_t()noexcept override final=default;
14271
14272 virtual void be_set(ptr a)noexcept override final{move(_m)=use_as<char_T>(a);}
14273 [[nodiscard]]virtual ptr get_value()noexcept override final{return core::make_binary_node_from<char_T>(move(_m));}
14274 [[nodiscard]]virtual base_data_t*copy()const noexcept override final{return get<arec_data_t>(*this);}
14275 [[nodiscard]]virtual base_type_info_t get_type_info()const noexcept override final{return type_info<arec_data_t>;}
14276 };
14277 return get<arec_data_t>(str,i);
14278 }
14279 }
14280
14281 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
14282 //_undefs.hpp
14283 /*
14284 未完成的elc解释器basic文件
14285 由steve02081504与Alex0125设计、编写
14286 转载时请在不对此文件做任何修改的同时注明出处
14287 项目地址:https://github.com/steve02081504/ELC
14288 */
14289 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_undefs.hpp"
14290 //_undefs.hpp
14291 /*
14292 未完成的elc解释器_share文件
14293 由steve02081504与Alex0125设计、编写
14294 转载时请在不对此文件做任何修改的同时注明出处
14295 项目地址:https://github.com/steve02081504/ELC
14296 */
14297
14298 //defs at "_defs.hpp"
14299
14300 #if defined(_MSC_VER)
14301 #pragma warning(pop)
14302 #endif
14303 #undef suppress_msvc_warning
14304 #undef disable_msvc_warning
14305 #undef push_msvc_warning
14306 #undef pop_msvc_warning
14307 #undef push_and_disable_msvc_warning
14308
14309 //for basic_environment.hpp
14310 #undef BIT_POSSIBILITY
14311 //
14312 #if defined(ELC_VOID_NAME)
14313 #define void the_void
14314 #endif
14315
14316 // #undef often_noexcept
14317 #undef noexcept_as
14318 #undef noexcept_as_auto
14319 #undef constexpr_as
14320 #undef constexpr_as_auto
14321
14322 #undef using_method_from_base_t
14323 #undef using_method_from_value
14324
14325 #undef floop
14326 #undef enable_adl
14327
14328 #undef re_declvalue
14329 #undef re_decltype
14330
14331 #undef declvalue
14332
14333 #undef template_error
14334 #undef template_warning
14335
14336 #undef type_info_of
14337 #undef type_name_of
14338
14339 #undef is_common_attribute
14340 #undef is_special_attribute
14341
14342 #undef has_attribute
14343 #undef not_has_attribute
14344
14345 #undef float_size_of
14346 #undef bitnum_of
14347
14348 #undef def_common_attribute_with_nothing
14349 #undef def_special_attribute_with_nothing
14350
14351 #undef common_attribute_t
14352 #undef special_attribute_t
14353
14354 #undef enable_if
14355 #undef enabled_by_default
14356 #undef disabled_by_default
14357 #undef enable_if_not_ill_form
14358 #undef enable_flag
14359
14360 #undef was_an_ill_form
14361 #undef was_an_ill_form_with_parameter
14362 #undef was_not_an_ill_form
14363 #undef was_not_an_ill_form_and_noexcept
14364 #undef was_not_an_ill_form_with_parameter
14365
14366 #undef recursive_lambda
14367 #undef get_recursive_lambda_caller
14368 #undef lambda
14369 #undef lambda_with_catch
14370 #undef self_recursion
14371 #undef lambda_RLSRRS
14372
14373 #undef MAGIC
14374
14375 #undef nothing
14376
14377 #undef elseif
14378 #undef _big_than_
14379 #undef _small_than_
14380
14381 #if defined(_MSC_VER)
14382 #undef not
14383 #undef and
14384 #undef or
14385 #endif
14386
14387 #undef INTER_NAMESPACE
14388 #undef BREAK_NAMESPACE
14389
14390 #undef szie
14391 #undef form
14392
14393 #undef template_name
14394 #undef type_name
14395
14396 #undef not_in_debug
14397
14398 #undef es
14399 #undef ec
14400
14401 #undef ELC_TEST_EVENTNAME
14402
14403 #undef override_instance_struct
14404
14405 #undef distinctive
14406
14407 #undef force_inline
14408
14409 #undef with_no_vtable
14410
14411 #undef in_consteval
14412
14413 #undef no_vtable_struct
14414 #undef no_vtable_class
14415
14416 //file_end
14417
14418 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
14419
14420 //file_end
14421
14422 #line 35 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_multi/string_arec_as_value.hpp"
14423 }
14424
14425 //file_end
14426
14427 #line 34 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/_body.hpp"
14428 #endif
14429
14430 //file_end
14431
14432 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/core"
14433 #endif
14434
14435 //file_end
14436
14437 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/all"
14438 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/lib_loader"
14439 //lib_loader
14440 //at namespace ::
14441 /*
14442 未完成的elc解释器include文件
14443 由steve02081504与Alex0125设计、编写
14444 转载时请在不对此文件做任何修改的同时注明出处
14445 项目地址:https://github.com/steve02081504/ELC
14446 */
14447 #if !defined(ELC_LIB_LOADER)
14448 #define ELC_LIB_LOADER
14449 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/string"
14450 //string
14451 //at namespace ::
14452 /*
14453 未完成的elc解释器include文件
14454 由steve02081504与Alex0125设计、编写
14455 转载时请在不对此文件做任何修改的同时注明出处
14456 项目地址:https://github.com/steve02081504/ELC
14457 */
14458 #if !defined(ELC_STRING)
14459 #define ELC_STRING
14460 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base"
14461 //base
14462 //at namespace ::
14463 /*
14464 未完成的elc解释器include文件
14465 由steve02081504与Alex0125设计、编写
14466 转载时请在不对此文件做任何修改的同时注明出处
14467 项目地址:https://github.com/steve02081504/ELC
14468 */
14469 #line 18 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base"
14470
14471 //file_end
14472
14473 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/string"
14474 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/_body.hpp"
14475 //_body.hpp
14476 //at namespace ::
14477 /*
14478 未完成的elc解释器string文件
14479 由steve02081504与Alex0125设计、编写
14480 转载时请在不对此文件做任何修改的同时注明出处
14481 项目地址:https://github.com/steve02081504/ELC
14482 */
14483 #if defined(ELC_TEST)
14484 #error "this part cannot be tested."
14485 #endif
14486 namespace elc::defs{
14487 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
14488 //_defs.hpp
14489 /*
14490 未完成的elc解释器basic文件
14491 由steve02081504与Alex0125设计、编写
14492 转载时请在不对此文件做任何修改的同时注明出处
14493 项目地址:https://github.com/steve02081504/ELC
14494 */
14495 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
14496 //_defs.hpp
14497 /*
14498 未完成的elc解释器_share文件
14499 由steve02081504与Alex0125设计、编写
14500 转载时请在不对此文件做任何修改的同时注明出处
14501 项目地址:https://github.com/steve02081504/ELC
14502 */
14503
14504 //undefs at "_undefs.hpp"
14505
14506 //set ELC_WARNING_LEVEL default to 4(max)
14507 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
14508
14509 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/basic_environment.hpp"
14510 //basic_environment.hpp
14511 /*
14512 未完成的elc解释器_share文件
14513 由steve02081504与Alex0125设计、编写
14514 转载时请在不对此文件做任何修改的同时注明出处
14515 项目地址:https://github.com/steve02081504/ELC
14516 */
14517
14520 #define BIT_POSSIBILITY 2
14521
14522 //file_end
14523
14524 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
14525
14526 #if defined(_MSC_VER)
14527 #pragma warning(push,ELC_WARNING_LEVEL)
14528 #pragma warning(disable:4099)//class与struct混用警告diss
14529 #pragma warning(disable:26812)//enum class安利diss.
14530 #pragma warning(disable:4584)//重复子类警告diss
14531 #pragma warning(disable:4250)//域控制继承警告diss
14532 #pragma warning(disable:26432)//不完全默认方法警告diss
14533 #pragma warning(disable:26435)//virtual override方法警告diss
14534 #pragma warning(disable:26481)//容器安利diss
14535 #pragma warning(disable:26446)//gsl::at安利diss
14536 #pragma warning(disable:26434)//方法覆盖警告diss
14537 #pragma warning(disable:26429)//gsl::not_null安利diss
14538 #pragma warning(disable:26471)//对void*进行static_cast安利diss
14539 #pragma warning(disable:26474)//隐式指针转换显式cast警告diss
14540 #pragma warning(disable:26473)//相同指针显式cast警告diss
14541 #pragma warning(disable:26456)//隐藏非虚运算符警告diss
14542 #pragma warning(disable:26485)//数组作指针警告diss
14543 #pragma warning(disable:26490)//reinterpret_cast警告diss
14544 #pragma warning(disable:26472)//static_cast窄幅转换警告diss
14545 #pragma warning(disable:26482)//非常数数组索引警告diss
14546 #pragma warning(disable:26493)//c_cast转换警告diss:虽然有用但是太烦了,爬
14547 #endif
14548 #if defined(_MSC_VER)
14549 #define suppress_msvc_warning(...) __pragma(warning(suppress:__VA_ARGS__))
14550 #define disable_msvc_warning(...) __pragma(warning(disable:__VA_ARGS__))
14551 #define push_msvc_warning() __pragma(warning(push))
14552 #define pop_msvc_warning() __pragma(warning(pop))
14553 #define push_and_disable_msvc_warning(...) push_msvc_warning() disable_msvc_warning(__VA_ARGS__)
14554 #else
14555 #define suppress_msvc_warning(...)
14556 #define disable_msvc_warning(...)
14557 #define push_msvc_warning()
14558 #define pop_msvc_warning()
14559 #define push_and_disable_msvc_warning(...)
14560 #endif
14561 //
14562 #if defined(ELC_VOID_NAME)
14563 #undef void
14564 #endif
14565
14566 // #define often_noexcept
14567 #define noexcept_as(...) noexcept(noexcept((__VA_ARGS__)))//dnmd C艹标准就是没有noexcept_as_auto
14568 #define noexcept_as_auto MAGIC//哦现在有了
14569 #define constexpr_as(...) MAGIC constexpr//( •̀ ω •́ )✌
14570 #define constexpr_as_auto MAGIC MAGIC constexpr//✌( •̀ ω •́ )✌
14571
14572 #define using_method_from_base_t(name,...) \
14573 template<class...Args> requires was_not_an_ill_form(declvalue(base_t).name(declvalue(Args)...))\
14574 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(base_t::name(declvalue(Args)...))\
14575 {\
14576 return base_t::name(forward<Args>(rest)...);\
14577 }\
14578
14579 #define using_method_from_value(name,value_name,...) \
14580 template<class...Args> requires was_not_an_ill_form(re_declvalue(value_name).name(declvalue(Args)...))\
14581 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(re_declvalue(value_name).name(declvalue(Args)...))\
14582 {\
14583 return value_name.name(forward<Args>(rest)...);\
14584 }\
14585
14586 #define floop while(__builtin_is_my_dick_still_there())
14587 #define enable_adl(name) void name()noexcept=delete
14588
14589 #define re_declvalue(...) (declvalue(decltype(__VA_ARGS__)))
14590 #define re_decltype(...) (decltype(declvalue(__VA_ARGS__)))
14591
14592 #define declvalue(...) (::std::declval<__VA_ARGS__>())
14593
14595 #define template_error(reason) static_assert(template_error_helper<T>,reason)
14597 #define template_warning(reason) template_warning_helper<T>(reason)
14598
14599 //for type_info
14600 #define type_info_of(...) base_type_info_t(typeid(__VA_ARGS__))
14601 #define type_name_of(...) (type_info_of(__VA_ARGS__).name())
14602
14603 #define is_common_attribute(name) public attribute<T,name<T>>
14604 #define is_special_attribute(name) public attribute<T,name>
14605
14606 #define has_attribute(...) template_name has_attribute_helper<__VA_ARGS__>()
14607 #define not_has_attribute(...) template_name not_has_has_attribute_helper<__VA_ARGS__>()
14608
14609 //for float_size_t
14610 #define float_size_of(...) (float_size_t{sizeof(__VA_ARGS__)})
14611 //bitnum_of
14612 #define bitnum_of(...) (bitnumof<__VA_ARGS__>)
14613
14614 //for attribute
14615 #define def_common_attribute_with_nothing(name) \
14616 template<typename T>\
14617 class name{}\
14618
14619 #define def_special_attribute_with_nothing(name) \
14620 class name{}\
14621
14622 #define common_attribute_t template<class>class
14623 #define special_attribute_t class
14624
14633 #define enable_if(...) class enable_state= ::std::enable_if_t<__VA_ARGS__>
14635 #define enabled_by_default class enable_state=void
14637 #define disabled_by_default class enable_state= ::std::enable_if_t<false>
14639 #define enable_if_not_ill_form(...) class enable_state= ::std::void_t<decltype(__VA_ARGS__)>
14641 #define enable_flag class enable_state
14642
14643 #define was_an_ill_form(...) (!was_not_an_ill_form(__VA_ARGS__))
14644 #define was_an_ill_form_with_parameter(...) (!was_not_an_ill_form_with_parameter(__VA_ARGS__))
14645 #define was_not_an_ill_form(...) (bool(requires{__VA_ARGS__;}))
14646 #define was_not_an_ill_form_and_noexcept(...) (bool(requires{__VA_ARGS__;{__VA_ARGS__}noexcept;}))
14647 #define was_not_an_ill_form_with_parameter(...) (bool(requires __VA_ARGS__ ))
14648
14650 #define recursive_lambda(...) lambda(auto&&lambda_RLSRRS,__VA_ARGS__)
14652 #define get_recursive_lambda_caller(name) \
14653 lambda_with_catch(&)(auto&&...Args){\
14654 return name(name,Args...);\
14655 }
14657 #define lambda []
14659 #define lambda_with_catch(...) [__VA_ARGS__]
14661 #define self_recursion(...) lambda_RLSRRS(lambda_RLSRRS,__VA_ARGS__)
14662 //recursive_lambda_self_referential_reserved_symbolname
14663 #define lambda_RLSRRS _my_jb_super_sb_name_
14664
14665 #define MAGIC//ahh,ko no tenno da!
14666
14668 #define nothing
14669
14671 #define elseif else if
14673 #define _big_than_ >
14675 #define _small_than_ <
14676
14677 #if defined(_MSC_VER)
14678 #define not !
14679 #define and &&
14680 #define or ||
14681 #endif
14682
14684 #define INTER_NAMESPACE(NAMESPACENAME) namespace NAMESPACENAME{
14686 #define BREAK_NAMESPACE }
14687
14689 #define template_name template
14691 #define type_name class
14692
14693 #if defined(DEBUG) || defined(_DEBUG)
14694 #define not_in_debug 0
14695 #else
14696 #define not_in_debug 1
14697 #endif
14698
14699 #define es U""
14700 #define ec(ch) U ## ch
14701
14702 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
14703 #define ELC_TEST_EVENTNAME(name) stest_eventer _the_stest_eventer__(L""name)
14704 #else
14705 #define ELC_TEST_EVENTNAME(name)
14706 #endif
14707
14708 #define override_instance_struct \
14709 protected:\
14710 virtual void abstract_method_unget_this()noexcept_as(instance_struct<this_t>::abstract_method_unget_this())override{instance_struct<this_t>::abstract_method_unget_this();}\
14711 virtual void* _abstract_method_copy_get_this()noexcept_as(instance_struct<this_t>::_abstract_method_copy_get_this())override{return instance_struct<this_t>::_abstract_method_copy_get_this();}\
14712 virtual void* _abstract_method_get_resize_this(size_t size)noexcept_as(instance_struct<this_t>::instance_struct<this_t>::_abstract_method_get_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_resize_this(size);}\
14713 virtual void* _abstract_method_get_forward_resize_this(size_t size)noexcept_as(instance_struct<this_t>::_abstract_method_get_forward_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_forward_resize_this(size);}\
14714 virtual size_t abstract_method_get_size_of_get_for_this()noexcept override{return instance_struct<this_t>::abstract_method_get_size_of_get_for_this();}
14715
14716 #if defined(_WIN32)
14717 #define distinctive __declspec(dllexport)
14718 #else
14719 #define distinctive
14720 #endif
14721
14722 #if defined(_WIN32)
14723 #define force_inline __forceinline
14724 #elif defined(__GNUC__)
14725 #define force_inline __attribute__((always_inline)) inline
14726 #else
14727 #define force_inline inline
14728 #endif
14729
14730 #if defined(_WIN32)
14731 #define with_no_vtable __declspec(novtable)
14732 #else
14733 #define with_no_vtable
14734 #endif
14735
14736 #define in_consteval (::std::is_constant_evaluated())
14737
14738 #define no_vtable_struct struct with_no_vtable
14739 #define no_vtable_class class with_no_vtable
14740
14741 //file_end
14742
14743 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
14744
14745 //file_end
14746
14747 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/_body.hpp"
14748
14749 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/defs.hpp"
14750 //defs.hpp
14751 //at namespace elc::defs
14752 /*
14753 未完成的elc解释器string文件
14754 由steve02081504与Alex0125设计、编写
14755 转载时请在不对此文件做任何修改的同时注明出处
14756 项目地址:https://github.com/steve02081504/ELC
14757 */
14758 namespace string_n{
14759 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/string_data_t/_body.hpp"
14760 //_body.hpp
14761 //at namespace elc::defs::string_n
14762 /*
14763 未完成的elc解释器string文件
14764 由steve02081504与Alex0125设计、编写
14765 转载时请在不对此文件做任何修改的同时注明出处
14766 项目地址:https://github.com/steve02081504/ELC
14767 */
14768 inline namespace string_data_n{
14769 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/string_data_t/_decl.hpp"
14770 //_decl.hpp
14771 //at namespace elc::defs::string_n::string_data_n
14772 /*
14773 未完成的elc解释器string文件
14774 由steve02081504与Alex0125设计、编写
14775 转载时请在不对此文件做任何修改的同时注明出处
14776 项目地址:https://github.com/steve02081504/ELC
14777 */
14778 template<typename char_T>
14779 struct base_string_data_t;
14780
14781 template<typename char_T>
14782 struct null_string_data_t;
14783 template<typename char_T>
14785
14786 template<typename char_T>
14787 struct comn_string_data_t;
14788
14789 template<typename char_T>
14790 struct substr_string_data_t;
14791
14792 template<typename char_T>
14794 template<typename char_T>
14796
14797 template<typename char_T>
14798 struct sum_string_data_t;
14799
14800 template<typename char_T>
14801 struct erased_string_data_t;
14802 template<typename char_T>
14804
14805 //template<typename char_T>
14806 //struct replaced_string_data_t;
14807
14808 template<typename char_T>
14810
14811 //file_end
14812
14813 #line 10 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/string_data_t/_body.hpp"
14814
14815 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/string_data_t/base_string_data_t.hpp"
14816 //base_string_data_t.hpp
14817 //at namespace elc::defs::string_n::string_data_n
14818 /*
14819 未完成的elc解释器string文件
14820 由steve02081504与Alex0125设计、编写
14821 转载时请在不对此文件做任何修改的同时注明出处
14822 项目地址:https://github.com/steve02081504/ELC
14823 */
14824 template<typename char_T>
14826 with_common_attribute<abstract_base,never_in_array,replace_able,ref_able>,build_by_get_only{
14828 typedef comn_ptr_t<this_t> ptr_t;
14830
14831 static_assert(noexcept(declvalue(ptr_t).operator*()));//貌似msvc在这里有bug
14832
14833 static constexpr bool copy_assign_nothrow=copy_assign.nothrow<char_T>;
14834 static constexpr bool copy_construct_nothrow=copy_construct.nothrow<char_T>;
14835 static constexpr bool move_construct_nothrow=move_construct.nothrow<char_T>;
14836 static constexpr bool construct_nothrow=construct<char_T>.nothrow<>;
14837 static constexpr bool destruct_nothrow=destruct.nothrow<char_T>;
14838 static constexpr bool clear_nothrow=destruct_nothrow;
14839 static constexpr bool ptr_reset_nothrow=destruct_nothrow;
14840 static constexpr bool hash_nothrow=hash.nothrow<char_T>;
14841 static constexpr bool get_data_nothrow=copy_construct_nothrow&&destruct_nothrow;
14842 static constexpr bool apply_data_nothrow=construct_nothrow&&copy_assign_nothrow;
14843
14844 friend class null_string_data_t<char_T>;
14845 friend class constexpr_string_data_t<char_T>;
14846 friend class comn_string_data_t<char_T>;
14847 friend class substr_string_data_t<char_T>;
14848 friend class head_apply_string_data_t<char_T>;
14849 friend class end_apply_string_data_t<char_T>;
14850 friend class sum_string_data_t<char_T>;
14851 friend class erased_string_data_t<char_T>;
14852 friend class inserted_string_data_t<char_T>;
14853 //friend class replaced_string_data_t<char_T>;
14854 friend class same_value_compress_string_data_t<char_T>;
14855
14856 base_string_data_t()noexcept=default;
14857 base_string_data_t(never_ref_num_zero_t)noexcept{ attribute_ptr_cast<ref_able>(this)->init_never_ref_num_zero(); }
14858
14859 [[nodiscard]]bool is_unique()noexcept{ return get_ref_num(this)==1; }
14860 virtual void be_replace_as(ptr_t a)noexcept(clear_nothrow)=0;
14861
14862 virtual ~base_string_data_t()noexcept(destruct_nothrow)=default;
14863
14864 [[nodiscard]]virtual char_T* get_c_str(ptr_t&)noexcept(get_data_nothrow);
14865 [[nodiscard]]virtual const char_T* get_const_c_str(ptr_t&p)noexcept(get_data_nothrow){return get_c_str(p);}
14866 [[nodiscard]]virtual const char_T* get_data(ptr_t&p)noexcept(get_data_nothrow){return get_c_str(p);}//不要求以0结尾
14867 [[nodiscard]]virtual char_T* get_unique_c_str(ptr_t&)noexcept(get_data_nothrow);
14868 [[nodiscard]]virtual size_t get_size()noexcept=0;
14869 [[nodiscard]]virtual ptr_t get_substr_data(size_t begin,size_t size)noexcept;
14870 [[nodiscard]]virtual ptr_t apply_str_to_begin(string_view_t str)noexcept(copy_construct_nothrow&&apply_data_nothrow);
14871 [[nodiscard]]virtual ptr_t apply_str_to_begin(ptr_t str)noexcept(apply_data_nothrow);
14872 [[nodiscard]]virtual ptr_t apply_str_to_end(string_view_t str)noexcept(copy_construct_nothrow&&apply_data_nothrow);
14873 [[nodiscard]]virtual ptr_t apply_str_to_end(ptr_t str)noexcept(apply_data_nothrow);
14874
14875 [[nodiscard]]virtual ptr_t do_insert(size_t pos,string_view_t str)noexcept(copy_construct_nothrow);
14876 [[nodiscard]]virtual ptr_t do_insert(size_t pos,ptr_t str)noexcept;
14877 [[nodiscard]]virtual ptr_t do_erase(size_t pos,size_t size)noexcept;
14878
14879 [[nodiscard]]virtual ptr_t do_pop_back(size_t size,ptr_t& self)noexcept(construct_nothrow&&copy_assign_nothrow){
14880 const auto pos = this->get_size()-size;
14881 const auto before = get_substr_data(0,pos);
14882 const auto after = get_substr_data(pos,size);
14883 self = before;
14884 return after;
14885 }
14886 [[nodiscard]]virtual ptr_t do_pop_front(size_t size,ptr_t& self)noexcept(construct_nothrow&&copy_assign_nothrow){
14887 const auto pos = size;
14888 const auto before = get_substr_data(0,pos);
14889 const auto after = get_substr_data(pos,this->get_size()-size);
14890 self = after;
14891 return before;
14892 }
14893 /*
14894 TODO:
14895
14896 find
14897 rfind
14898 find_first_of
14899 find_first_not_of
14900 find_last_of
14901 find_last_not_of
14902
14903 starts_with
14904 ends_with
14905 contains
14906 replace
14907 */
14909 protected:
14910 bool same_type(ptr_t a)noexcept{return typeid(*this)==typeid(*a);}
14911 [[nodiscard]]virtual bool same_struct(ptr_t)noexcept=0;
14912 [[nodiscard]]virtual bool same_struct_equal(ptr_t with)noexcept(equal.nothrow<char_T>)=0;
14913 [[nodiscard]]virtual compare_type same_struct_compare(ptr_t with)noexcept(compare.nothrow<char_T>)=0;
14914 protected:
14916 public:
14917 [[nodiscard]]bool equal_with(ptr_t with)noexcept(equal.nothrow<char_T>){
14918 //eq->equal优化
14919 if(this==with)
14920 return true;
14921 //hash_diff->not_equal优化
14922 if(this->has_hash_cache()&&with->has_hash_cache())
14923 if(this->get_hash_cache()!=with->get_hash_cache())
14924 return false;
14925 //size比较优化被移至string_t实现内部:原因:same_struct_compare大部分情况下size相同。
14926 //快速比较结束,实际比较段
14927 {
14928 suppress_msvc_warning(26494)//未初始化警告diss
14929 bool aret;
14930 {
14931 //同结构比较优化比较方式
14932 if(same_type(with)&&same_struct(with))
14933 aret=same_struct_equal(with);
14934 //否则默认比较
14935 else
14936 aret=default_equal_method(with);
14937 }
14938 //如果equal,则eq处理
14939 if(aret)
14940 equivalent_optimization(this,with);
14941 return aret;
14942 }
14943 }
14944 protected:
14945 [[nodiscard]]bool default_equal_method(ptr_t with)noexcept(equal.nothrow<char_T>){
14946 const size_t self_size=get_size();
14947 return equal_with(with,0,self_size);
14948 }
14949 public:
14950 [[nodiscard]]bool equal_with(ptr_t with,size_t pos,size_t size)noexcept(equal.nothrow<char_T>){
14951 //eq->equal优化
14952 if(this==with)
14953 return true;
14954 size_t index=pos;
14955 auto a=this->get_the_largest_complete_data_block_begin_form(index);
14956 auto b=with->get_the_largest_complete_data_block_begin_form(index);
14957 while(size){
14958 const size_t step=min({a.size(),b.size(),size});
14959 if(a.begin()!=b.begin())//起始地址不同时才需要真的比较
14960 if(!equal(a.begin(),b.begin(),step))
14961 return false;
14962 index+=step;
14963 size-=step;
14964 if(a.size()==step)
14965 a=this->get_the_largest_complete_data_block_begin_form(index);
14966 else
14967 a={a.begin()+step,note::size(a.size()-step)};
14968 if(b.size()==step)
14969 b=with->get_the_largest_complete_data_block_begin_form(index);
14970 else
14971 b={b.begin()+step,note::size(b.size()-step)};
14972 if(!a.size()&&!b.size())
14973 return a.size()==b.size();
14974 }
14975 return true;
14976 }
14977 [[nodiscard]]bool equal_with(string_view_t with)noexcept(equal.nothrow<char_T>){
14978 size_t size=with.size();
14979 size_t index=0;
14980 auto a=this->get_the_largest_complete_data_block_begin_form(index);
14981 if(a.begin()==with.begin() && a.size()==with.size())
14982 return true;
14983 floop{
14984 auto b=with.begin()+index;
14985 const size_t step=min({a.size(),with.size()-index,size});
14986 if(!equal(a.begin(),b,step))
14987 return false;
14988 index+=step;
14989 size-=step;
14990 if(a.size()==step)
14991 a=this->get_the_largest_complete_data_block_begin_form(index);
14992 else
14993 a={a.begin()+step,note::size(a.size()-step)};
14994 if(!a.size()||!size)
14995 return a.size()==size;
14996 }
14997 }
14998 [[nodiscard]]bool equal_with(const char_T*with)noexcept(equal.nothrow<char_T>){
14999 size_t size=get_size();
15000 size_t index=0;
15001 auto a=this->get_the_largest_complete_data_block_begin_form(index);
15002 if(a.begin()==with && with[a.size()]==char_T{})
15003 return true;
15004 floop{
15005 auto b=with+index;
15006 if(!*b)
15007 return false;
15008 size_t step=min({a.size(),size});
15009 if(!equal(a.begin(),step,just_an_part,b,end_by_zero))
15010 return false;
15011 index+=step;
15012 size-=step;
15013 if(a.size()==step)
15014 a=this->get_the_largest_complete_data_block_begin_form(index);
15015 else
15016 a={a.begin()+step,note::size(a.size()-step)};
15017 if(!*(b+step))
15018 return !a.size();
15019 if(!a.size())
15020 return !*(b+step);
15021 }
15022 }
15023 public:
15024 [[nodiscard]]compare_type compare_with(ptr_t with)noexcept(compare.nothrow<char_T>){
15025 //eq->equal优化
15026 if(this==with)
15027 return strong_ordering::equivalent;
15028 //size比较优化被移至string_t实现内部:原因:same_struct_compare大部分情况下size相同。
15029 //快速比较结束,实际比较段
15030 {
15031 suppress_msvc_warning(26494)//未初始化警告diss
15032 compare_type aret;
15033 {
15034 //同结构比较优化比较方式
15035 if(same_type(with)&&same_struct(with))
15036 aret=same_struct_compare(with);
15037 //否则默认比较
15038 else
15039 aret=default_compare_method(with);
15040 }
15041 //如果equal,则eq处理
15042 if(aret==0)
15043 equivalent_optimization(this,with);
15044 return aret;
15045 }
15046 }
15047 protected:
15048 [[nodiscard]]compare_type default_compare_method(ptr_t with)noexcept(compare.nothrow<char_T>){
15049 const size_t self_size=get_size();
15050 return compare_with(with,0,self_size);
15051 }
15052 public:
15053 [[nodiscard]]compare_type compare_with(ptr_t with,size_t pos,size_t size)noexcept(compare.nothrow<char_T>){
15054 //eq->equal优化
15055 if(this==with)
15056 return strong_ordering::equivalent;
15057 size_t index=pos;
15058 auto a=this->get_the_largest_complete_data_block_begin_form(index);
15059 auto b=with->get_the_largest_complete_data_block_begin_form(index);
15060 while(size){
15061 const size_t step=min({a.size(),b.size(),size});
15062 if(a.begin()!=b.begin())//起始地址不同时才需要真的比较
15063 if(auto tmp=compare(a.begin(),b.begin(),step); tmp!=0)
15064 return tmp;
15065 index+=step;
15066 size-=step;
15067 if(a.size()==step)
15068 a=this->get_the_largest_complete_data_block_begin_form(index);
15069 else
15070 a={a.begin()+step,note::size(a.size()-step)};
15071 if(b.size()==step)
15072 b=with->get_the_largest_complete_data_block_begin_form(index);
15073 else
15074 b={b.begin()+step,note::size(b.size()-step)};
15075 if(!a.size()||!b.size())
15076 return a.size()<=>b.size();
15077 }
15078 return strong_ordering::equivalent;
15079 }
15080 [[nodiscard]]compare_type compare_with(string_view_t with)noexcept(compare.nothrow<char_T>){
15081 size_t size=with.size();
15082 size_t index=0;
15083 auto a=this->get_the_largest_complete_data_block_begin_form(index);
15084 if(a.begin()==with.begin() && a.size()==with.size())
15085 return strong_ordering::equivalent;
15086 floop{
15087 auto b=with.begin()+index;
15088 size_t step=min({a.size(),with.size()-index,size});
15089 if(auto tmp=compare(a.begin(),b,step); tmp!=0)
15090 return tmp;
15091 index+=step;
15092 size-=step;
15093 if(a.size()==step)
15094 a=this->get_the_largest_complete_data_block_begin_form(index);
15095 else
15096 a={a.begin()+step,note::size(a.size()-step)};
15097 if(!a.size()||!size)
15098 return a.size()<=>size;
15099 }
15100 }
15101 [[nodiscard]]compare_type compare_with(const char_T*with)noexcept(compare.nothrow<char_T>){
15102 size_t size=get_size();
15103 size_t index=0;
15104 auto a=this->get_the_largest_complete_data_block_begin_form(index);
15105 if(a.begin()==with && with[a.size()]==char_T{})
15106 return strong_ordering::equivalent;
15107 floop{
15108 auto b=with+index;
15109 if(!*b)
15110 return strong_ordering::greater;
15111 size_t step=min({a.size(),size});
15112 if(auto tmp=compare(a.begin(),step,just_an_part,b,end_by_zero); tmp!=0)
15113 return tmp;
15114 index+=step;
15115 size-=step;
15116 if(a.size()==step)
15117 a=this->get_the_largest_complete_data_block_begin_form(index);
15118 else
15119 a={a.begin()+step,note::size(a.size()-step)};
15120 if(!a.size())
15121 return *(with+index)==char_T{}? strong_ordering::equivalent:
15122 strong_ordering::less;
15123 if(!*(with+index))
15124 return strong_ordering::greater;
15125 }
15126 }
15127 protected:
15128 virtual void copy_part_data_to(char_T* to,size_t pos,size_t size)noexcept(copy_assign_nothrow)=0;
15129 public:
15130 [[nodiscard]]virtual char_T arec(size_t index)noexcept(copy_construct_nothrow&&move_construct_nothrow)=0;
15131 virtual void arec_set(size_t index,char_T a,ptr_t& p)noexcept(copy_assign_nothrow&&move_construct_nothrow)=0;
15132 protected:
15133 hash_t _hash_cache{};
15134 bool _has_hash_cache=false;
15135 bool has_hash_cache()noexcept{return _has_hash_cache;}
15136 void reset_hash_cache()noexcept{_has_hash_cache=false;}
15137 hash_t get_hash_cache()noexcept{return _hash_cache;}
15138 hash_t set_hash_cache(hash_t value)noexcept{_has_hash_cache=true;return _hash_cache=value;}
15139 public:
15140 hash_t get_hash(ptr_t&p)noexcept(hash_nothrow){
15141 if(has_hash_cache())
15142 return get_hash_cache();
15143 else{
15144 const auto tmp=this->get_hash_detail(p);
15145 return p->set_hash_cache(tmp);
15146 }
15147 }
15148 protected:
15149 virtual hash_t get_hash_detail(ptr_t&p)noexcept(hash_nothrow){
15150 const auto size=get_size();
15151 const auto data=get_data(p);
15152 return hash(data,size);
15153 }
15154 public:
15155 hash_t get_others_hash_with_calculated_before(hash_t before,size_t before_size,ptr_t&p,size_t pos,size_t size)noexcept(hash_nothrow){
15156 if(pos==0&&size==get_size())
15157 return hash.merge_array_hash_results(before,before_size,get_hash(p),size);
15158 return this->get_others_hash_with_calculated_before_detail(before,before_size,p,pos,size);
15159 }
15160 protected:
15161 virtual hash_t get_others_hash_with_calculated_before_detail(hash_t before,size_t before_size,ptr_t&p,size_t pos,size_t size)noexcept(hash_nothrow){
15162 return hash.with_calculated_before(before,before_size,get_data(p)+pos,size);
15163 }
15164 protected:
15165 void self_changed()noexcept{
15166 reset_hash_cache();
15167 }
15168 [[nodiscard]]virtual float_size_t get_base_memory_cost()noexcept=0;
15169 public:
15170 [[nodiscard]]float_size_t get_memory_cost()noexcept{
15171 return get_base_memory_cost()/get_ref_num(this);
15172 }
15173 [[nodiscard]]float_size_t get_memory_cost_after_gc()noexcept;
15174 [[nodiscard]]float_size_t get_gc_profit()noexcept{return get_memory_cost()-get_memory_cost_after_gc();}
15175 [[nodiscard]]bool positive_gc_profit()noexcept{return get_gc_profit() > 0;}
15176 //for gc:
15177 /*
15178 [[nodiscard]]virtual bool gc()=0{
15179 bool need_be_replace=get_gc_profit()>=0
15180 if(need_be_replace)
15181 this->be_replace_as(get<comn_string_data_t>(this));
15182 return need_be_replace;
15183 }
15184 */
15185
15186 [[nodiscard]]virtual const range_n::match_pattern<const char_T>& get_match_pattern_from_self(ptr_t&self)noexcept(copy_assign_nothrow&&move_construct_nothrow);
15187 [[nodiscard]]virtual const range_n::reverse_match_pattern<const char_T>& get_reverse_match_pattern_from_self(ptr_t&self)noexcept(copy_assign_nothrow&&move_construct_nothrow);
15188
15189 protected:
15190 static inline void be_replace(this_t* a,ptr_t b)noexcept(ptr_reset_nothrow){
15191 a->be_replace_as(b);
15192 }
15193 static inline void be_replace(ptr_t& a,ptr_t b)noexcept(ptr_reset_nothrow){
15194 a.do_replace(b);
15195 }
15196 static inline void equivalent_optimization(auto&& a,auto&& b)noexcept(ptr_reset_nothrow){
15197 if(a->get_memory_cost() >= b->get_memory_cost())
15198 be_replace(a,b);
15199 else
15200 be_replace(b,a);
15201 }
15202 };
15203 template<typename char_T>
15204 void base_string_data_t<char_T>::be_replace_as(ptr_t a)noexcept(clear_nothrow){
15206 }
15207
15208 //file_end
15209
15210 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/string_data_t/_body.hpp"
15211
15212 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/string_data_t/null_string_data_t.hpp"
15213 //null_string_data_t.hpp
15214 //at namespace elc::defs::string_n::string_data_n
15215 /*
15216 未完成的elc解释器string文件
15217 由steve02081504与Alex0125设计、编写
15218 转载时请在不对此文件做任何修改的同时注明出处
15219 项目地址:https://github.com/steve02081504/ELC
15220 */
15221 template<typename char_T>
15222 struct null_string_data_t final:base_string_data_t<char_T>,instance_struct<null_string_data_t<char_T>>{
15225 using base_t::ptr_t;
15227
15228 using base_t::copy_assign_nothrow;
15229 using base_t::copy_construct_nothrow;
15230 using base_t::move_construct_nothrow;
15231 using base_t::construct_nothrow;
15232 using base_t::destruct_nothrow;
15233 using base_t::clear_nothrow;
15234 using base_t::ptr_reset_nothrow;
15235 using base_t::hash_nothrow;
15236 using base_t::get_data_nothrow;
15237 using base_t::apply_data_nothrow;
15238 using base_t::set_hash_cache;
15239
15240 null_string_data_t()noexcept:base_t(never_ref_num_zero){}
15241
15242 virtual void be_replace_as(ptr_t a)noexcept(clear_nothrow)override final{nothing;}
15243 [[nodiscard]]virtual char_T* get_c_str(ptr_t&)noexcept override final{
15244 static char_T data[1]{};
15245 return data;
15246 }
15247 [[nodiscard]]virtual size_t get_size()noexcept override final{ return 0; }
15248 [[nodiscard]]virtual ptr_t get_substr_data([[maybe_unused]]size_t begin,[[maybe_unused]]size_t size)noexcept override final{ return this; }
15249 [[nodiscard]]virtual ptr_t apply_str_to_begin(string_view_t str)noexcept(copy_construct_nothrow&&apply_data_nothrow)override final{ return get<comn_string_data_t<char_T>>(str); }
15250 [[nodiscard]]virtual ptr_t apply_str_to_begin(ptr_t str)noexcept(apply_data_nothrow)override final{ return str; }
15251 [[nodiscard]]virtual ptr_t apply_str_to_end(string_view_t str)noexcept(copy_construct_nothrow&&apply_data_nothrow)override final{ return get<comn_string_data_t<char_T>>(str); }
15252 [[nodiscard]]virtual ptr_t apply_str_to_end(ptr_t str)noexcept override final{ return str; }
15253
15254 [[nodiscard]]virtual ptr_t do_insert([[maybe_unused]]size_t pos,[[maybe_unused]]string_view_t str)noexcept(construct_nothrow&&copy_assign_nothrow)override final{ return get<comn_string_data_t<char_T>>(str); }
15255 [[nodiscard]]virtual ptr_t do_insert([[maybe_unused]]size_t pos,[[maybe_unused]]ptr_t str)noexcept override final{ return str; }
15256 [[nodiscard]]virtual ptr_t do_erase([[maybe_unused]]size_t pos,[[maybe_unused]]size_t size)noexcept override final{ return this; }
15257 protected:
15258 virtual void copy_part_data_to([[maybe_unused]]char_T* to,[[maybe_unused]]size_t pos,[[maybe_unused]]size_t size)noexcept override final{ return; }
15259 public:
15260 [[nodiscard]]virtual char_T arec([[maybe_unused]]size_t index)noexcept override final{ return char_T{}; }
15261 virtual void arec_set([[maybe_unused]]size_t index,[[maybe_unused]]char_T a,[[maybe_unused]]ptr_t& p)noexcept override final{ nothing; }
15262 [[nodiscard]]virtual ptr_t do_pop_back([[maybe_unused]]size_t size,[[maybe_unused]]ptr_t& self)noexcept override final{ return this; }
15263 [[nodiscard]]virtual ptr_t do_pop_front([[maybe_unused]]size_t size,[[maybe_unused]]ptr_t& self)noexcept override final{ return this; }
15264 protected:
15265 virtual hash_t get_hash_detail([[maybe_unused]]ptr_t&p)noexcept override final{ return hash(nothing); }
15266 virtual hash_t get_others_hash_with_calculated_before_detail([[maybe_unused]]hash_t before,[[maybe_unused]]size_t before_size,[[maybe_unused]]ptr_t&p,[[maybe_unused]]size_t pos,[[maybe_unused]]size_t size)noexcept override final{ return before; }
15267 protected:
15268 [[nodiscard]]virtual bool same_struct(ptr_t)noexcept override final{return false;}
15269 [[nodiscard]]virtual range_t<const char_T*> get_the_largest_complete_data_block_begin_form([[maybe_unused]]size_t begin)noexcept override final{return {0,0};}
15270 [[nodiscard]]virtual bool same_struct_equal(ptr_t with)noexcept override final{return false;}
15271 [[nodiscard]]virtual base_t::compare_type same_struct_compare(ptr_t with)noexcept override final{return strong_ordering::equivalent;}
15272 [[nodiscard]]virtual float_size_t get_base_memory_cost()noexcept override final{return 0;}
15273 };
15274 template<typename char_T>
15276 template<typename char_T>
15277 base_string_data_t<char_T>* the_get_null_ptr(const base_string_data_t<char_T>*)noexcept{ return&null_string_data<char_T>; }
15278
15279 //file_end
15280
15281 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/string_data_t/_body.hpp"
15282 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/string_data_t/constexpr_string_data_t.hpp"
15283 //constexpr_string_data_t.hpp
15284 //at namespace elc::defs::string_n::string_data_n
15285 /*
15286 未完成的elc解释器string文件
15287 由steve02081504与Alex0125设计、编写
15288 转载时请在不对此文件做任何修改的同时注明出处
15289 项目地址:https://github.com/steve02081504/ELC
15290 */
15291 template<typename char_T>
15292 struct constexpr_string_data_t final:base_string_data_t<char_T>,instance_struct<constexpr_string_data_t<char_T>>{
15295 using base_t::ptr_t;
15297
15298 using base_t::copy_assign_nothrow;
15299 using base_t::copy_construct_nothrow;
15300 using base_t::move_construct_nothrow;
15301 using base_t::construct_nothrow;
15302 using base_t::destruct_nothrow;
15303 using base_t::clear_nothrow;
15304 using base_t::ptr_reset_nothrow;
15305 using base_t::hash_nothrow;
15306 using base_t::get_data_nothrow;
15307 using base_t::apply_data_nothrow;
15308 using base_t::set_hash_cache;
15309
15310 const char_T* _m;
15311 size_t _size;
15312
15313 const range_n::match_pattern<const char_T>* _p_match_pattern = nullptr;
15314 const range_n::reverse_match_pattern<const char_T>* _p_reverse_match_pattern = nullptr;
15315 bool match_pattern_by_get = 0;
15316
15317 void clear_match_pattern()noexcept{
15318 if(match_pattern_by_get){
15319 unget(remove_const(_p_match_pattern));
15320 unget(remove_const(_p_reverse_match_pattern));
15321 _p_match_pattern = nullptr;
15322 _p_reverse_match_pattern = nullptr;
15323 }
15324 }
15325
15327 _m=str.begin();
15328 _size=str.size();
15329 set_hash_cache(hash(str));
15330 _p_match_pattern=&str.match_pattern;
15331 _p_reverse_match_pattern=&str.reverse_match_pattern;
15332 match_pattern_by_get=0;
15333 }
15335 _m=str.begin();
15336 _size=str.size();
15337 if(!_size)
15338 be_replace_as(null_ptr);
15339 }
15340 virtual ~constexpr_string_data_t()noexcept(destruct_nothrow)override final{
15341 clear_match_pattern();
15342 }
15343
15344 [[nodiscard]]virtual ptr_t get_substr_data(size_t begin,size_t size)noexcept override final{
15345 return get<this_t>(string_view_t{_m+begin,size});
15346 }
15347 [[nodiscard]]virtual const char_T* get_data(ptr_t&)noexcept(get_data_nothrow)override final{return _m;}
15348 [[nodiscard]]virtual const char_T* get_const_c_str(ptr_t&p)noexcept(get_data_nothrow)override final{
15349 if(!_m[_size])
15350 return _m;
15351 else
15352 return base_t::get_const_c_str(p);
15353 }
15354 [[nodiscard]]virtual size_t get_size()noexcept override final{ return _size; }
15355 protected:
15356 virtual void copy_part_data_to(char_T* to,size_t pos,size_t size)noexcept(copy_assign_nothrow)override final{ copy_assign[size](note::from(_m+pos),note::to(to)); }
15357 public:
15358 [[nodiscard]]virtual char_T arec(size_t index)noexcept(copy_construct_nothrow&&move_construct_nothrow)override final{ return _m[index]; }
15359
15360 virtual void be_replace_as(ptr_t a)noexcept(clear_nothrow)override final{base_t::be_replace_as(a);}
15361 virtual void arec_set(size_t index,char_T a,ptr_t&p)noexcept override final{base_t::arec_set(index,a,p);}
15362
15363 [[nodiscard]]virtual bool same_struct(ptr_t with)noexcept override final{
15364 return true;//总size被保证一样
15365 }
15366 [[nodiscard]]virtual range_t<const char_T*> get_the_largest_complete_data_block_begin_form(size_t begin)noexcept override final{return {&_m[begin],note::size(_size-begin)};}
15367 [[nodiscard]]virtual bool same_struct_equal(ptr_t with)noexcept(equal.nothrow<char_T>)override final{
15368 auto wp=down_cast<this_t*>(with.get());
15369 if(_m==wp->_m)
15370 return true;
15371 return equal(_m,wp->_m,_size);
15372 }
15373 [[nodiscard]]virtual base_t::compare_type same_struct_compare(ptr_t with)noexcept(compare.nothrow<char_T>)override final{
15374 auto wp=down_cast<this_t*>(with.get());
15375 if(_m==wp->_m)
15376 return strong_ordering::equivalent;
15377 return compare(_m,wp->_m,_size);
15378 }
15379 protected:
15380 [[nodiscard]]virtual float_size_t get_base_memory_cost()noexcept override final{
15381 return float_size_of(*this);
15382 }
15383 public:
15384 [[nodiscard]]virtual const range_n::match_pattern<const char_T>& get_match_pattern_from_self(ptr_t&self)noexcept(copy_assign_nothrow&&move_construct_nothrow)override final{
15385 if(!_p_match_pattern){
15386 _p_match_pattern=get<range_n::match_pattern<const char_T>>(array_like_view_t{this->get_data(self),this->get_size()});
15387 match_pattern_by_get = 1;
15388 }
15389 return *_p_match_pattern;
15390 }
15391 [[nodiscard]]virtual const range_n::reverse_match_pattern<const char_T>&get_reverse_match_pattern_from_self(ptr_t&self)noexcept(copy_assign_nothrow&&move_construct_nothrow)override final{
15392 if(!_p_reverse_match_pattern){
15393 _p_reverse_match_pattern=get<range_n::reverse_match_pattern<const char_T>>(array_like_view_t{this->get_data(self),this->get_size()});
15394 match_pattern_by_get = 1;
15395 }
15396 return *_p_reverse_match_pattern;
15397 }
15398 };
15399
15400 //file_end
15401
15402 #line 15 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/string_data_t/_body.hpp"
15403
15404 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/string_data_t/comn_string_data_t.hpp"
15405 //comn_string_data_t.hpp
15406 //at namespace elc::defs::string_n::string_data_n
15407 /*
15408 未完成的elc解释器string文件
15409 由steve02081504与Alex0125设计、编写
15410 转载时请在不对此文件做任何修改的同时注明出处
15411 项目地址:https://github.com/steve02081504/ELC
15412 */
15413 template<typename char_T>
15414 struct comn_string_data_t final:base_string_data_t<char_T>,instance_struct<comn_string_data_t<char_T>>{
15417 using base_t::ptr_t;
15419 using base_t::self_changed;
15420
15421 using base_t::copy_assign_nothrow;
15422 using base_t::copy_construct_nothrow;
15423 using base_t::move_construct_nothrow;
15424 using base_t::construct_nothrow;
15425 using base_t::destruct_nothrow;
15426 using base_t::clear_nothrow;
15427 using base_t::ptr_reset_nothrow;
15428 using base_t::hash_nothrow;
15429 using base_t::get_data_nothrow;
15430 using base_t::apply_data_nothrow;
15431 using base_t::set_hash_cache;
15432
15433 array_t<char_T> _m;
15434 range_n::match_pattern<const char_T>* _p_match_pattern = nullptr;
15435 range_n::reverse_match_pattern<const char_T>* _p_reverse_match_pattern = nullptr;
15436 void clear_match_pattern()noexcept{
15437 unget(_p_match_pattern);
15438 unget(_p_reverse_match_pattern);
15439 base_t::self_changed();
15440 }
15441 void self_changed()noexcept{
15442 clear_match_pattern();
15443 base_t::self_changed();
15444 }
15445
15446 comn_string_data_t(string_view_t str)noexcept(construct_nothrow&&copy_assign_nothrow):_m(note::size(str.size()+1)){
15447 copy_assign[str.size()](note::from(str.begin()),note::to((char_T*)_m));
15448 _m[str.size()]=zero;
15449 }
15450 comn_string_data_t(ptr_t str)noexcept(construct_nothrow&&copy_assign_nothrow):_m(note::size(str->get_size()+1)){
15451 auto size=this->get_size();
15452 str->copy_part_data_to((char_T*)_m,0,size);
15453 _m[size]=zero;
15454 }
15455 comn_string_data_t(ptr_t str,size_t pos,size_t size)noexcept(construct_nothrow&&copy_assign_nothrow):_m(note::size(size+1)){
15456 str->copy_part_data_to((char_T*)_m,pos,size);
15457 _m[size]=zero;
15458 }
15459 comn_string_data_t(size_t size,char_T ch)noexcept(construct_nothrow&&copy_assign_nothrow):_m(note::size(size+1),ch){
15460 _m[size]=zero;
15461 }
15462 comn_string_data_t(size_t size)noexcept(construct_nothrow&&copy_assign_nothrow):_m(note::size(size+1)){
15463 _m[size]=zero;
15464 }
15465
15466 virtual ~comn_string_data_t()noexcept(destruct_nothrow)override final{
15467 clear_match_pattern();
15468 }
15469
15470 virtual void be_replace_as(ptr_t a)noexcept(clear_nothrow)override final{
15471 _m.clear();
15472 base_t::be_replace_as(a);
15473 }
15474 [[nodiscard]]virtual char_T* get_c_str(ptr_t&)noexcept override final{ return (char_T*)_m; }
15475 [[nodiscard]]virtual char_T* get_unique_c_str(ptr_t&p)noexcept(get_data_nothrow)override final{
15476 if(this->is_unique())
15477 return (char_T*)_m;
15478 else
15479 return base_t::get_unique_c_str(p);
15480 }
15481 [[nodiscard]]virtual size_t get_size()noexcept override final{ return _m.size()-1; }
15482 protected:
15483 virtual void copy_part_data_to(char_T* to,size_t pos,size_t size)noexcept(copy_assign_nothrow)override final{ copy_assign[size](note::from((const char_T*)_m+pos),note::to(to)); }
15484 public:
15485 [[nodiscard]]virtual char_T arec(size_t index)noexcept(copy_construct_nothrow&&move_construct_nothrow)override final{ return _m[index]; }
15486 virtual void arec_set(size_t index,char_T a,ptr_t&p)noexcept(copy_assign_nothrow&&move_construct_nothrow)override final{
15487 if(this->is_unique()){
15488 copy_assign(_m[index],a);
15489 self_changed();
15490 }
15491 else
15492 base_t::arec_set(index,a,p);
15493 }
15494
15495 [[nodiscard]]virtual bool same_struct(ptr_t)noexcept override final{
15496 return true;//总size被保证一样
15497 }
15498 [[nodiscard]]virtual range_t<const char_T*> get_the_largest_complete_data_block_begin_form(size_t begin)noexcept override final{return {&_m[begin],note::size(get_size()-begin)};}
15499 [[nodiscard]]virtual bool same_struct_equal(ptr_t with)noexcept(equal.nothrow<char_T>)override final{
15500 auto wp=down_cast<this_t*>(with.get());
15501 return equal(_m, wp->_m);
15502 }
15503 [[nodiscard]]virtual base_t::compare_type same_struct_compare(ptr_t with)noexcept(compare.nothrow<char_T>)override final{
15504 auto wp=down_cast<this_t*>(with.get());
15505 return compare(_m, wp->_m);
15506 }
15507 protected:
15508 [[nodiscard]]virtual float_size_t get_base_memory_cost()noexcept override final{
15509 return float_size_of(*this) + _m.size_in_byte();
15510 }
15511 public:
15512 [[nodiscard]]virtual const range_n::match_pattern<const char_T>& get_match_pattern_from_self(ptr_t&self)noexcept(copy_assign_nothrow&&move_construct_nothrow)override final{
15513 if(!_p_match_pattern){
15514 _p_match_pattern=get<range_n::match_pattern<const char_T>>(array_like_view_t{this->get_data(self),this->get_size()});
15515 }
15516 return *_p_match_pattern;
15517 }
15518 [[nodiscard]]virtual const range_n::reverse_match_pattern<const char_T>&get_reverse_match_pattern_from_self(ptr_t&self)noexcept(copy_assign_nothrow&&move_construct_nothrow)override final{
15519 if(!_p_reverse_match_pattern){
15520 _p_reverse_match_pattern=get<range_n::reverse_match_pattern<const char_T>>(array_like_view_t{this->get_data(self),this->get_size()});
15521 }
15522 return *_p_reverse_match_pattern;
15523 }
15524 };
15525 template<typename char_T>
15526 [[nodiscard]]char_T* base_string_data_t<char_T>::get_c_str(ptr_t&a)noexcept(get_data_nothrow){
15527 auto comn_data=get<comn_string_data_t<char_T>>(this);
15528 if(positive_gc_profit())
15529 a.do_replace(comn_data);
15530 else
15531 a=comn_data;
15532 return comn_data->get_c_str(a);
15533 }
15534 template<typename char_T>
15535 [[nodiscard]]char_T* base_string_data_t<char_T>::get_unique_c_str(ptr_t&a)noexcept(get_data_nothrow){
15536 auto comn_data=get<comn_string_data_t<char_T>>(this);
15537 a=comn_data;
15538 return comn_data->get_c_str(a);
15539 }
15540 template<typename char_T>
15541 void base_string_data_t<char_T>::arec_set(size_t index,char_T a,ptr_t& p)noexcept(copy_assign_nothrow&&move_construct_nothrow){
15542 copy_assign(this->get_unique_c_str(p)[index],a);
15543 }
15544 template<typename char_T>
15546 const auto size_of_base_array=this->get_size()*sizeof(char_T);
15547 const auto size=float_size_of(comn_string_data_t<char_T>)+size_of_base_array;
15548 return size/get_ref_num(this);
15549 }
15550 template<typename char_T>
15551 [[nodiscard]]const range_n::match_pattern<const char_T>& base_string_data_t<char_T>::get_match_pattern_from_self(ptr_t&self)noexcept(copy_assign_nothrow&&move_construct_nothrow){
15552 auto comn_data=get<comn_string_data_t<char_T>>(this);
15553 self=comn_data;
15554 return comn_data->get_match_pattern_from_self(self);
15555 }
15556 template<typename char_T>
15557 [[nodiscard]]const range_n::reverse_match_pattern<const char_T>& base_string_data_t<char_T>::get_reverse_match_pattern_from_self(ptr_t&self)noexcept(copy_assign_nothrow&&move_construct_nothrow){
15558 auto comn_data=get<comn_string_data_t<char_T>>(this);
15559 self=comn_data;
15560 return comn_data->get_reverse_match_pattern_from_self(self);
15561 }
15562
15563 //file_end
15564
15565 #line 17 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/string_data_t/_body.hpp"
15566
15567 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/string_data_t/substr_string_data_t.hpp"
15568 //substr_string_data_t.hpp
15569 //at namespace elc::defs::string_n::string_data_n
15570 /*
15571 未完成的elc解释器string文件
15572 由steve02081504与Alex0125设计、编写
15573 转载时请在不对此文件做任何修改的同时注明出处
15574 项目地址:https://github.com/steve02081504/ELC
15575 */
15576 template<typename char_T>
15577 struct substr_string_data_t final:base_string_data_t<char_T>,instance_struct<substr_string_data_t<char_T>>{
15580 using base_t::ptr_t;
15582 using base_t::self_changed;
15583
15584 using base_t::copy_assign_nothrow;
15585 using base_t::copy_construct_nothrow;
15586 using base_t::move_construct_nothrow;
15587 using base_t::construct_nothrow;
15588 using base_t::destruct_nothrow;
15589 using base_t::clear_nothrow;
15590 using base_t::ptr_reset_nothrow;
15591 using base_t::hash_nothrow;
15592 using base_t::get_data_nothrow;
15593 using base_t::apply_data_nothrow;
15594 using base_t::set_hash_cache;
15595
15599
15601 if(!_sub_size)
15602 be_replace_as(null_ptr);
15603 }
15604
15605 substr_string_data_t(ptr_t str,size_t sub_begin,size_t sub_size)noexcept:_to(str),_sub_begin(sub_begin),_sub_size(sub_size){
15606 null_equivalent_check();
15607 }
15608
15609 virtual void be_replace_as(ptr_t a)noexcept(clear_nothrow)override final{
15610 _to.reset();
15611 base_t::be_replace_as(a);
15612 }
15613 [[nodiscard]]virtual ptr_t get_substr_data(size_t begin,size_t size)noexcept override final{ return get<substr_string_data_t<char_T>>(_to,begin+_sub_begin,size); }
15614 [[nodiscard]]virtual const char_T* get_const_c_str(ptr_t&p)noexcept(get_data_nothrow)override final{
15615 if(_sub_begin+_sub_size==_to->get_size())
15616 return _to->get_const_c_str(_to)+_sub_begin;
15617 else
15618 return base_t::get_const_c_str(p);
15619 }
15620 [[nodiscard]]virtual const char_T* get_data(ptr_t&)noexcept(get_data_nothrow)override final{ return _to->get_data(_to)+_sub_begin; }
15621 [[nodiscard]]virtual size_t get_size()noexcept override final{ return _sub_size; }
15622 protected:
15623 virtual void copy_part_data_to(char_T* to,size_t pos,size_t size)noexcept(copy_assign_nothrow)override final{ _to->copy_part_data_to(to,pos+_sub_begin,size); }
15624 public:
15625 [[nodiscard]]virtual char_T arec(size_t index)noexcept(copy_construct_nothrow&&move_construct_nothrow)override final{ return _to->arec(index+_sub_begin); }
15626 virtual void arec_set(size_t index,char_T a,ptr_t& p)noexcept(copy_assign_nothrow&&move_construct_nothrow)override final{
15627 if(this->is_unique()){
15628 _to->arec_set(index+_sub_begin,a,_to);
15629 self_changed();
15630 }
15631 else
15632 base_t::arec_set(index,a,p);
15633 }
15634 [[nodiscard]]virtual ptr_t apply_str_to_begin(string_view_t str)noexcept(copy_construct_nothrow&&apply_data_nothrow)override final{
15635 if(this->is_unique() && _sub_begin==0){
15636 _to=_to->apply_str_to_begin(str);
15637 _sub_size+=str.size();
15638 self_changed();
15639 return this;
15640 }
15641 else
15642 return base_t::apply_str_to_begin(str);
15643 }
15644 [[nodiscard]]virtual ptr_t apply_str_to_begin(ptr_t str)noexcept(apply_data_nothrow)override final{
15645 if(this->is_unique() && _sub_begin==0){
15646 _to=_to->apply_str_to_begin(str);
15647 _sub_size+=str->get_size();
15648 self_changed();
15649 return this;
15650 }
15651 else
15652 return base_t::apply_str_to_begin(str);
15653 }
15654 [[nodiscard]]virtual ptr_t apply_str_to_end(string_view_t str)noexcept(copy_construct_nothrow&&apply_data_nothrow)override final{
15655 if(this->is_unique() && _sub_begin+_sub_size==_to->get_size()){
15656 _to=_to->apply_str_to_end(str);
15657 _sub_size+=str.size();
15658 self_changed();
15659 return this;
15660 }
15661 else
15662 return base_t::apply_str_to_end(str);
15663 }
15664 [[nodiscard]]virtual ptr_t apply_str_to_end(ptr_t str)noexcept(apply_data_nothrow)override final{
15665 if(this->is_unique() && _sub_begin+_sub_size==_to->get_size()){
15666 _to=_to->apply_str_to_end(str);
15667 _sub_size+=str->get_size();
15668 self_changed();
15669 return this;
15670 }
15671 else
15672 return base_t::apply_str_to_end(str);
15673 }
15674 [[nodiscard]]virtual ptr_t do_pop_front(size_t size,ptr_t& self)noexcept(construct_nothrow&&copy_assign_nothrow)override final{
15675 if(this->is_unique() && _sub_begin==0){
15676 auto aret=_to->do_pop_front(size,_to);
15677 _sub_size-=size;
15678 null_equivalent_check();
15679 self_changed();
15680 return aret;
15681 }
15682 else
15683 return base_t::do_pop_front(size,self);
15684 }
15685 [[nodiscard]]virtual ptr_t do_pop_back(size_t size,ptr_t& self)noexcept(construct_nothrow&&copy_assign_nothrow)override final{
15686 if(this->is_unique() && _sub_begin+_sub_size==_to->get_size()){
15687 auto aret=_to->do_pop_back(size,_to);
15688 _sub_size-=size;
15689 null_equivalent_check();
15690 self_changed();
15691 return aret;
15692 }
15693 else
15694 return base_t::do_pop_back(size,self);
15695 }
15696 protected:
15697 virtual hash_t get_hash_detail(ptr_t&)noexcept(hash_nothrow)override final{
15698 auto result=hash(nothing);
15699 result=_to->get_others_hash_with_calculated_before(result,0,_to,_sub_begin,_sub_size);
15700 return result;
15701 }
15702 virtual hash_t get_others_hash_with_calculated_before_detail(hash_t before,size_t before_size,ptr_t&,size_t pos,size_t size)noexcept(hash_nothrow)override final{
15703 return _to->get_others_hash_with_calculated_before(before,before_size,_to,pos+_sub_begin,size);
15704 }
15705 protected:
15706 [[nodiscard]]virtual bool same_struct(ptr_t with)noexcept override final{
15707 auto wp = down_cast<this_t*>(with.get());
15708 return _sub_begin == wp->_sub_begin;//总size被保证一样
15709 }
15710 [[nodiscard]]virtual range_t<const char_T*> get_the_largest_complete_data_block_begin_form(size_t begin)noexcept override final{
15711 auto result = _to->get_the_largest_complete_data_block_begin_form(_sub_begin+begin);
15712 auto size = min(result.size(),_sub_size-begin);
15713 return {result.begin(), note::size(size)};
15714 }
15715 [[nodiscard]]virtual bool same_struct_equal(ptr_t with)noexcept(equal.nothrow<char_T>)override final{
15716 auto wp=down_cast<this_t*>(with.get());
15717 return _to->equal_with(wp->_to,_sub_begin,_sub_size);
15718 }
15719 [[nodiscard]]virtual base_t::compare_type same_struct_compare(ptr_t with)noexcept(compare.nothrow<char_T>)override final{
15720 auto wp=down_cast<this_t*>(with.get());
15721 return _to->compare_with(wp->_to,_sub_begin,_sub_size);
15722 }
15723 [[nodiscard]]virtual float_size_t get_base_memory_cost()noexcept override final{
15724 return float_size_of(*this)+_to->get_memory_cost();
15725 }
15726 };
15727 template<typename char_T>
15729 if(begin==0&&size==get_size())
15730 return this;
15731 else
15732 return get<substr_string_data_t<char_T>>(this,begin,size);
15733 }
15734
15735 //file_end
15736
15737 #line 19 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/string_data_t/_body.hpp"
15738
15739 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/string_data_t/head_apply_string_data_t.hpp"
15740 //end_apply_string_data_t.hpp
15741 //at namespace elc::defs::string_n::string_data_n
15742 /*
15743 未完成的elc解释器string文件
15744 由steve02081504与Alex0125设计、编写
15745 转载时请在不对此文件做任何修改的同时注明出处
15746 项目地址:https://github.com/steve02081504/ELC
15747 */
15748 template<typename char_T>
15749 struct head_apply_string_data_t final:base_string_data_t<char_T>,instance_struct<head_apply_string_data_t<char_T>>{
15752 using base_t::ptr_t;
15754 using base_t::self_changed;
15755
15756 using base_t::copy_assign_nothrow;
15757 using base_t::copy_construct_nothrow;
15758 using base_t::move_construct_nothrow;
15759 using base_t::construct_nothrow;
15760 using base_t::destruct_nothrow;
15761 using base_t::clear_nothrow;
15762 using base_t::ptr_reset_nothrow;
15763 using base_t::hash_nothrow;
15764 using base_t::get_data_nothrow;
15765 using base_t::apply_data_nothrow;
15766 using base_t::set_hash_cache;
15767
15768 array_t<char_T> _m;//意义为向前延续的数组:当需要向前附加内容时向前拓展以避免重新分配内存
15770 size_t _to_size;
15772
15773 head_apply_string_data_t(ptr_t str,string_view_t head)noexcept(construct_nothrow&&copy_assign_nothrow):
15774 _to_size(str->get_size()),
15775 _used_size(head.size()),
15776 _to(str)
15777 {
15778 _m.resize(get_next_gold_size_to_resize_for_array(_to_size+_used_size));
15779 copy_assign[_used_size](note::from<const char_T*>(head.begin()),note::to<char_T*>(_m.end()-_used_size));
15780 }
15781
15782 [[nodiscard]]virtual ptr_t get_substr_data(size_t begin,size_t size)noexcept override final{
15783 if(begin>=_used_size)
15784 return _to->get_substr_data(begin-_used_size,size);
15785 else
15786 return base_t::get_substr_data(begin,size);
15787 }
15788 [[nodiscard]]virtual char_T* get_c_str(ptr_t&p)noexcept(get_data_nothrow)override final{
15789 if(!_used_size)
15790 return _to->get_c_str(_to);
15791 else
15792 return base_t::get_c_str(p);
15793 }
15794 virtual void be_replace_as(ptr_t a)noexcept(clear_nothrow)override final{
15795 if(type_info<this_t> == typeid(*a)){
15796 const auto p = down_cast<this_t*>(a.get());
15797 if(_used_size==p->_used_size && _to!=p->_to)
15798 base_t::equivalent_optimization(_to, p->_to);
15799 }
15800 _m.clear();
15801 _to.reset();
15802 base_t::be_replace_as(a);
15803 }
15804 [[nodiscard]]virtual size_t get_size()noexcept override final{ return _used_size+_to_size; }
15805 [[nodiscard]]virtual ptr_t do_insert(size_t pos,string_view_t str)noexcept(copy_construct_nothrow)override final{
15806 if(pos==0)
15807 return this->apply_str_to_begin(str);
15808 elseif(pos==get_size())
15809 return this->apply_str_to_end(str);
15810 elseif(this->is_unique()){
15811 if(pos<_used_size){
15812 if(_m.size()-_used_size<str.size()){
15813 const auto size_now=this->get_size()+str.size();
15814 const auto size_new=get_next_gold_size_to_resize_for_array(size_now);
15815 _m.insert_with_forward_resize(pos,str.size(),str.begin(),size_new);
15816 }
15817 else{
15818 char_T* orogin_head_begin=_m.end()-_used_size;
15819 char_T* head_begin=orogin_head_begin-str.size();
15820 copy_assign[pos](note::from<const char_T*>(orogin_head_begin),note::to<char_T*>(head_begin));
15821 copy_assign[str.size()](note::from<const char_T*>(str.begin()),note::to<char_T*>(head_begin+pos));
15822 }
15823 _used_size+=str.size();
15824 }else{
15825 _to=_to->do_insert(pos-_used_size,str);
15826 _to_size=_to->get_size();
15827 }
15828 self_changed();
15829 return this;
15830 }
15831 else
15832 return base_t::do_insert(pos,str);
15833 }
15834 protected:
15835 virtual void copy_part_data_to(char_T* to,size_t pos,size_t size)noexcept(copy_assign_nothrow)override final{
15836 if(pos<_used_size){
15837 const char_T* head_begin=_m.end()-_used_size;
15838 const char_T* head_end=_m.end();
15839 const char_T* copy_begin=pos+head_begin;
15840 size_t size_of_copy_from_head=min(size_t(head_end-copy_begin),size);
15841
15842 copy_assign[size_of_copy_from_head](note::from(copy_begin),note::to(to));
15843 if(size!=size_of_copy_from_head){
15844 const size_t size_left=size-size_of_copy_from_head;
15845 char_T* next_copy_begin_pos=to+size_of_copy_from_head;
15846 _to->copy_part_data_to(next_copy_begin_pos,0,size_left);
15847 }
15848 }
15849 else
15850 _to->copy_part_data_to(to,pos-_used_size,size);
15851 }
15852 public:
15853 [[nodiscard]]virtual char_T arec(size_t index)noexcept(copy_construct_nothrow&&move_construct_nothrow)override final{
15854 if(index<_used_size){
15855 const char_T* head_begin=_m.end()-_used_size;
15856 return head_begin[index];
15857 }
15858 else
15859 return _to->arec(index-_used_size);
15860 }
15861 virtual void arec_set(size_t index,char_T a,ptr_t& p)noexcept(copy_assign_nothrow&&move_construct_nothrow)override final{
15862 if(this->is_unique()){
15863 if(index<_used_size){
15864 char_T* head_begin=_m.end()-_used_size;
15865 copy_assign(head_begin[index],a);
15866 }
15867 else
15868 _to->arec_set(index-_used_size,a,_to);
15869 self_changed();
15870 }
15871 else
15872 base_t::arec_set(index,a,p);
15873 }
15874 [[nodiscard]]virtual ptr_t apply_str_to_begin(string_view_t str)noexcept(copy_construct_nothrow&&apply_data_nothrow)override final{
15875 if(this->is_unique()){
15876 if(_m.size()-_used_size<str.size()){
15877 const auto size_now=this->get_size()+str.size();
15878 const auto size_new=get_next_gold_size_to_resize_for_array(size_now);
15879 _m.insert_with_forward_resize(0,str.size(),str.begin(),size_new);
15880 }
15881 else
15882 copy_assign[str.size()](note::from<const char_T*>(str.begin()),note::to<char_T*>(_m.end()-_used_size-str.size()));
15883 _used_size+=str.size();
15884 self_changed();
15885 return this;
15886 }
15887 else
15888 return base_t::apply_str_to_begin(str);
15889 }
15890 [[nodiscard]]virtual ptr_t apply_str_to_begin(ptr_t str)noexcept(apply_data_nothrow)override final{
15891 this->shrink();
15892 return base_t::apply_str_to_begin(str);
15893 }
15894 void shrink()noexcept(_m.forward_resize_nothrow){
15895 _m.forward_resize(_used_size);
15896 }
15897 [[nodiscard]]virtual ptr_t apply_str_to_end(string_view_t str)noexcept(copy_construct_nothrow&&apply_data_nothrow)override final{
15898 if(this->is_unique()){
15899 _to=_to->apply_str_to_end(str);
15900 _to_size+=str.size();
15901 self_changed();
15902 return this;
15903 }
15904 else
15905 return base_t::apply_str_to_end(str);
15906 }
15907 [[nodiscard]]virtual ptr_t apply_str_to_end(ptr_t str)noexcept(apply_data_nothrow)override final{
15908 if(this->is_unique()){
15909 _to=_to->apply_str_to_end(str);
15910 _to_size+=str->get_size();
15911 self_changed();
15912 return this;
15913 }
15914 else
15915 return base_t::apply_str_to_end(str);
15916 }
15917 [[nodiscard]]virtual ptr_t do_pop_front(size_t size,ptr_t& self)noexcept(construct_nothrow&&copy_assign_nothrow)override final{
15918 if(this->is_unique() && _used_size>=size){
15919 _used_size-=size;
15920 self_changed();
15921 return get<comn_string_data_t<char_T>>(string_view_t{(char_T*)_m.end()-_used_size-size,size});
15922 }
15923 else
15924 return base_t::do_pop_front(size,self);
15925 }
15926 [[nodiscard]]virtual ptr_t do_pop_back(size_t size,ptr_t& self)noexcept(construct_nothrow&&copy_assign_nothrow)override final{
15927 if(this->is_unique()){
15928 auto aret=_to->do_pop_back(size,_to);
15929 _to_size-=size;
15930 self_changed();
15931 return aret;
15932 }
15933 else
15934 return base_t::do_pop_back(size,self);
15935 }
15936 protected:
15937 virtual hash_t get_hash_detail(ptr_t&)noexcept(hash_nothrow)override final{
15938 suppress_msvc_warning(26494)//未初始化警告diss
15939 hash_t result;
15940 if(_used_size){
15941 const char_T* head_begin=_m.end()-_used_size;
15942 result=hash(head_begin,_used_size);
15943 if(_to_size)
15944 result=hash.merge_array_hash_results(result,_used_size,_to->get_hash(_to),_to_size);
15945 }
15946 else
15947 result=_to->get_hash(_to);
15948 return result;
15949 }
15950 virtual hash_t get_others_hash_with_calculated_before_detail(hash_t before,size_t before_size,ptr_t&,size_t pos,size_t size)noexcept(hash_nothrow)override final{
15951 if(pos<_used_size){
15952 const char_T* head_begin=_m.end()-_used_size;
15953 const char_T* head_end=_m.end();
15954 const char_T* calculate_begin=pos+head_begin;
15955 const size_t size_of_calculate_from_head=min(size_t(head_end-calculate_begin),size);
15956
15957 before=hash.with_calculated_before(before,before_size,calculate_begin,size_of_calculate_from_head);
15958 if(size!=size_of_calculate_from_head){
15959 const size_t size_left=size-size_of_calculate_from_head;
15960 before_size+=size_of_calculate_from_head;
15961 before=_to->get_others_hash_with_calculated_before(before,before_size,_to,0,size_left);
15962 }
15963 }
15964 else
15965 before=_to->get_others_hash_with_calculated_before(before,before_size,_to,pos-_used_size,size);
15966 return before;
15967 }
15968 protected:
15969 [[nodiscard]]virtual bool same_struct(ptr_t with)noexcept override final{
15970 auto wp=down_cast<this_t*>(with.get());
15971 return _used_size==wp->_used_size;// && _to_size==wp->_to_size; //总size被保证一样
15972 }
15973 [[nodiscard]]virtual range_t<const char_T*> get_the_largest_complete_data_block_begin_form(size_t begin)noexcept override final{
15974 if(begin >= _used_size)
15975 return _to->get_the_largest_complete_data_block_begin_form(begin-_used_size);
15976 else {
15977 const char_T* head_begin = _m.end() - _used_size;
15978 const char_T* head_end = _m.end();
15979 const char_T* ret_begin = begin+head_begin;
15980 return {ret_begin, head_end};
15981 }
15982 }
15983 [[nodiscard]]virtual bool same_struct_equal(ptr_t with)noexcept(equal.nothrow<char_T>)override final{
15984 auto wp=down_cast<this_t*>(with.get());
15985 const char_T* head_begin = _m.end() - _used_size;
15986 const char_T* wp_head_begin = wp->_m.end() - _used_size;
15987 if(!equal(head_begin,wp_head_begin,_used_size))
15988 return false;
15989 return _to->equal_with(wp->_to);
15990 }
15991 [[nodiscard]]virtual base_t::compare_type same_struct_compare(ptr_t with)noexcept(compare.nothrow<char_T>)override final{
15992 auto wp=down_cast<this_t*>(with.get());
15993 const char_T* head_begin = _m.end() - _used_size;
15994 const char_T* wp_head_begin = wp->_m.end() - _used_size;
15995 if(auto tmp=compare(head_begin,wp_head_begin,_used_size); tmp!=0)
15996 return tmp;
15997 return _to->compare_with(wp->_to);
15998 }
15999 [[nodiscard]]virtual float_size_t get_base_memory_cost()noexcept override final{
16000 return _to->get_memory_cost()+float_size_of(*this)+_m.size_in_byte();
16001 }
16002 };
16003 template<typename char_T>
16004 [[nodiscard]]base_string_data_t<char_T>::ptr_t base_string_data_t<char_T>::apply_str_to_begin(string_view_t str)noexcept(copy_construct_nothrow&&apply_data_nothrow){
16005 if(str.size())
16006 return get<head_apply_string_data_t<char_T>>(this,str);
16007 else
16008 return this;
16009 }
16010
16011 //file_end
16012
16013 #line 21 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/string_data_t/_body.hpp"
16014 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/string_data_t/end_apply_string_data_t.hpp"
16015 //end_apply_string_data_t.hpp
16016 //at namespace elc::defs::string_n::string_data_n
16017 /*
16018 未完成的elc解释器string文件
16019 由steve02081504与Alex0125设计、编写
16020 转载时请在不对此文件做任何修改的同时注明出处
16021 项目地址:https://github.com/steve02081504/ELC
16022 */
16023 template<typename char_T>
16024 struct end_apply_string_data_t final:base_string_data_t<char_T>,instance_struct<end_apply_string_data_t<char_T>>{
16027 using base_t::ptr_t;
16029 using base_t::self_changed;
16030
16031 using base_t::copy_assign_nothrow;
16032 using base_t::copy_construct_nothrow;
16033 using base_t::move_construct_nothrow;
16034 using base_t::construct_nothrow;
16035 using base_t::destruct_nothrow;
16036 using base_t::clear_nothrow;
16037 using base_t::ptr_reset_nothrow;
16038 using base_t::hash_nothrow;
16039 using base_t::get_data_nothrow;
16040 using base_t::apply_data_nothrow;
16041 using base_t::set_hash_cache;
16042
16043 array_t<char_T> _m;
16045 size_t _to_size;
16047
16048 end_apply_string_data_t(ptr_t str,string_view_t end)noexcept(construct_nothrow&&copy_assign_nothrow):
16049 _to_size(str->get_size()),
16050 _used_size(end.size()),
16051 _to(str)
16052 {
16053 _m.resize(get_next_gold_size_to_resize_for_array(_to_size+_used_size));
16054 copy_assign[_used_size](note::from(end.begin()),note::to((char_T*)_m));
16055 }
16056 end_apply_string_data_t(ptr_t str,size_t count,char_T ch)noexcept:
16057 _to_size(str->get_size()),
16058 _used_size(count),
16059 _to(str)
16060 {
16061 _m.resize(get_next_gold_size_to_resize_for_array(_to_size+_used_size));
16062 copy_assign[_used_size](ch,note::to((char_T*)_m));
16063 }
16064 end_apply_string_data_t(ptr_t str,size_t count)noexcept:
16065 _to_size(str->get_size()),
16066 _used_size(count),
16067 _to(str)
16068 {
16069 _m.resize(get_next_gold_size_to_resize_for_array(_to_size+_used_size));
16070 }
16071
16072 [[nodiscard]]virtual ptr_t get_substr_data(size_t begin,size_t size)noexcept override final{
16073 if(begin+size<=_to_size)
16074 return _to->get_substr_data(begin,size);
16075 else
16076 return base_t::get_substr_data(begin,size);
16077 }
16078 [[nodiscard]]virtual char_T* get_c_str(ptr_t&p)noexcept(get_data_nothrow)override final{
16079 if(!_used_size)
16080 return _to->get_c_str(_to);
16081 else
16082 return base_t::get_c_str(p);
16083 }
16084 virtual void be_replace_as(ptr_t a)noexcept(clear_nothrow)override final{
16085 if(type_info<this_t> == typeid(*a)){
16086 const auto p = down_cast<this_t*>(a.get());
16087 if(_used_size==p->_used_size && _to!=p->_to)
16088 base_t::equivalent_optimization(_to, p->_to);
16089 }
16090 _m.clear();
16091 _to.reset();
16092 base_t::be_replace_as(a);
16093 }
16094 [[nodiscard]]virtual size_t get_size()noexcept override final{ return _used_size+_to_size; }
16095 [[nodiscard]]virtual ptr_t do_insert(size_t pos,string_view_t str)noexcept(copy_construct_nothrow)override final{
16096 if(pos==0)
16097 return this->apply_str_to_begin(str);
16098 elseif(pos==get_size())
16099 return this->apply_str_to_end(str);
16100 elseif(this->is_unique()){
16101 if(pos<_to_size){
16102 _to=_to->do_insert(pos-_used_size,str);
16103 _to_size=_to->get_size();
16104 }
16105 else{
16106 pos-=_to_size;
16107 if(_m.size()-_used_size<str.size()){
16108 const auto size_now=this->get_size()+str.size();
16109 const auto size_new=get_next_gold_size_to_resize_for_array(size_now);
16110 _m.insert_with_resize(pos,str.size(),str.begin(),size_new);
16111 }
16112 else{
16113 copy_assign[_used_size-pos](note::from<const char_T*>(&_m[pos]),note::to((char_T*)&_m[pos+str.size()]));
16114 copy_assign[str.size()](note::from<const char_T*>(str.begin()),note::to<char_T*>(&_m[pos]));
16115 }
16116 _used_size+=str.size();
16117 }
16118 self_changed();
16119 return this;
16120 }
16121 else
16122 return base_t::do_insert(pos,str);
16123 }
16124 protected:
16125 virtual void copy_part_data_to(char_T* to,size_t pos,size_t size)noexcept(copy_assign_nothrow)override final{
16126 if(pos+size<=_to_size)
16127 _to->copy_part_data_to(to,pos,size);
16128 else{
16129 if(pos<_to_size){
16130 _to->copy_part_data_to(to,pos,_to_size-pos);
16131 auto copied_size=_to_size-pos;
16132 pos=0;
16133 size-=copied_size;
16134 to+=copied_size;
16135 }
16136 else
16137 pos-=_to_size;
16138 copy_assign[size](note::from((const char_T*)_m+pos),note::to(to));
16139 }
16140 }
16141 public:
16142 [[nodiscard]]virtual char_T arec(size_t index)noexcept(copy_construct_nothrow&&move_construct_nothrow)override final{
16143 if(index<_to_size)
16144 return _to->arec(index);
16145 else
16146 return _m[index-_to_size];
16147 }
16148 virtual void arec_set(size_t index,char_T a,ptr_t& p)noexcept(copy_assign_nothrow&&move_construct_nothrow)override final{
16149 if(this->is_unique()){
16150 if(index<_to_size)
16151 _to->arec_set(index,a,_to);
16152 else
16153 copy_assign(_m[index - _to_size],a);
16154 self_changed();
16155 }
16156 else
16157 base_t::arec_set(index,a,p);
16158 }
16159
16160 [[nodiscard]]virtual ptr_t apply_str_to_end(string_view_t str)noexcept(copy_construct_nothrow&&apply_data_nothrow)override final{
16161 if(this->is_unique()){
16162 if(_m.size()-_used_size < str.size()){
16163 const auto size_now=this->get_size()+str.size();
16164 const auto size_new=get_next_gold_size_to_resize_for_array(size_now);
16165 _m.insert_with_resize(_used_size,str.size(),str.begin(),size_new);
16166 }
16167 else
16168 copy_assign[str.size()](note::from(str.begin()),note::to((char_T*)_m+_used_size));
16169 _used_size+=str.size();
16170 self_changed();
16171 return this;
16172 }
16173 else
16174 return base_t::apply_str_to_end(str);
16175 }
16176 [[nodiscard]]virtual ptr_t apply_str_to_end(ptr_t str)noexcept(apply_data_nothrow)override final{
16177 this->shrink();
16178 return base_t::apply_str_to_end(str);
16179 }
16180 [[nodiscard]]virtual ptr_t apply_str_to_begin(string_view_t str)noexcept(copy_construct_nothrow&&apply_data_nothrow)override final{
16181 if(this->is_unique()){
16182 _to=_to->apply_str_to_begin(str);
16183 _to_size+=str.size();
16184 self_changed();
16185 return this;
16186 }
16187 else
16188 return base_t::apply_str_to_begin(str);
16189 }
16190 [[nodiscard]]virtual ptr_t apply_str_to_begin(ptr_t str)noexcept(apply_data_nothrow)override final{
16191 if(this->is_unique()){
16192 _to=_to->apply_str_to_begin(str);
16193 _to_size+=str->get_size();
16194 self_changed();
16195 return this;
16196 }
16197 else
16198 return base_t::apply_str_to_begin(str);
16199 }
16200 [[nodiscard]]virtual ptr_t do_pop_front(size_t size,ptr_t& self)noexcept(construct_nothrow&&copy_assign_nothrow)override final{
16201 if(this->is_unique()){
16202 auto aret=_to->do_pop_front(size,_to);
16203 _to_size-=size;
16204 self_changed();
16205 return aret;
16206 }
16207 else
16208 return base_t::do_pop_front(size,self);
16209 }
16210 [[nodiscard]]virtual ptr_t do_pop_back(size_t size,ptr_t& self)noexcept(construct_nothrow&&copy_assign_nothrow)override final{
16211 if(this->is_unique() && _used_size>=size){
16212 _used_size-=size;
16213 self_changed();
16214 return get<comn_string_data_t<char_T>>(string_view_t{(char_T*)_m+_used_size,size});
16215 }
16216 else
16217 return base_t::do_pop_back(size,self);
16218 }
16219 protected:
16220 virtual hash_t get_hash_detail(ptr_t&)noexcept(hash_nothrow)override final{
16221 return hash.with_calculated_before(_to->get_hash(_to),_to_size,string_view_t(_m.begin(),_used_size));
16222 }
16223 virtual hash_t get_others_hash_with_calculated_before_detail(hash_t before,size_t before_size,ptr_t&,size_t pos,size_t size)noexcept(hash_nothrow)override final{
16224 if(pos+size<=_to_size)
16225 before=_to->get_others_hash_with_calculated_before(before,before_size,_to,pos,size);
16226 else{
16227 if(pos<_to_size){
16228 before=_to->get_others_hash_with_calculated_before(before,before_size,_to,pos,_to_size-pos);
16229 const auto calculated_size=_to_size-pos;
16230 pos=0;
16231 size-=calculated_size;
16232 before_size+=calculated_size;
16233 }
16234 else
16235 pos-=_to_size;
16236 before=hash.with_calculated_before(before,before_size,(const char_T*)_m+pos,size);
16237 }
16238 return before;
16239 }
16240 void shrink()noexcept(_m.resize_nothrow){
16241 _m.resize(_used_size);
16242 }
16243 protected:
16244 [[nodiscard]]virtual bool same_struct(ptr_t with)noexcept override final{
16245 auto wp = down_cast<this_t*>(with.get());
16246 return _used_size==wp->_used_size;// && _to_size==wp->_to_size; //总size被保证一样
16247 }
16248 [[nodiscard]]virtual range_t<const char_T*> get_the_largest_complete_data_block_begin_form(size_t begin)noexcept override final{
16249 if(begin < _to_size){
16250 return _to->get_the_largest_complete_data_block_begin_form(begin);
16251 }
16252 else {
16253 begin-=_to_size;
16254 return {_m.begin()+begin,note::size(_used_size-begin)};
16255 }
16256 }
16257 [[nodiscard]]virtual bool same_struct_equal(ptr_t with)noexcept(equal.nothrow<char_T>)override final{
16258 auto wp=down_cast<this_t*>(with.get());
16259 if(!_to->equal_with(wp->_to))
16260 return false;
16261 return equal((char_T*)_m.begin(),(char_T*)wp->_m.begin(),_used_size);
16262 }
16263 [[nodiscard]]virtual base_t::compare_type same_struct_compare(ptr_t with)noexcept(compare.nothrow<char_T>)override final{
16264 auto wp=down_cast<this_t*>(with.get());
16265 if(auto tmp=_to->compare_with(wp->_to); tmp!=0)
16266 return tmp;
16267 return compare((char_T*)_m.begin(),(char_T*)wp->_m.begin(),_used_size);
16268 }
16269 [[nodiscard]]virtual float_size_t get_base_memory_cost()noexcept override final{
16270 return _to->get_memory_cost()+float_size_of(*this)+_m.size_in_byte();
16271 }
16272 };
16273 template<typename char_T>
16274 [[nodiscard]]base_string_data_t<char_T>::ptr_t base_string_data_t<char_T>::apply_str_to_end(string_view_t str)noexcept(copy_construct_nothrow&&apply_data_nothrow){
16275 if(str.size())
16276 return get<end_apply_string_data_t<char_T>>(this,str);
16277 else
16278 return this;
16279 }
16280
16281 //file_end
16282
16283 #line 22 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/string_data_t/_body.hpp"
16284
16285 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/string_data_t/sum_string_data_t.hpp"
16286 //sum_string_data_t.hpp
16287 //at namespace elc::defs::string_n::string_data_n
16288 /*
16289 未完成的elc解释器string文件
16290 由steve02081504与Alex0125设计、编写
16291 转载时请在不对此文件做任何修改的同时注明出处
16292 项目地址:https://github.com/steve02081504/ELC
16293 */
16294 template<typename char_T>
16295 struct sum_string_data_t final:base_string_data_t<char_T>,instance_struct<sum_string_data_t<char_T>>{
16298 using base_t::ptr_t;
16300 using base_t::self_changed;
16301
16302 using base_t::copy_assign_nothrow;
16303 using base_t::copy_construct_nothrow;
16304 using base_t::move_construct_nothrow;
16305 using base_t::construct_nothrow;
16306 using base_t::destruct_nothrow;
16307 using base_t::clear_nothrow;
16308 using base_t::ptr_reset_nothrow;
16309 using base_t::hash_nothrow;
16310 using base_t::get_data_nothrow;
16311 using base_t::apply_data_nothrow;
16312 using base_t::set_hash_cache;
16313
16318
16319 sum_string_data_t(ptr_t before,ptr_t after)noexcept:_before(before),_after(after),_before_size(_before->get_size()),_after_size(_after->get_size()){
16320 if(!_before_size)
16321 be_replace_as(_after);
16322 elseif(!_after_size)
16323 be_replace_as(_before);
16324 }
16325
16326 [[nodiscard]]virtual ptr_t get_substr_data(size_t begin,size_t size)noexcept override final{
16327 if(begin+size<=_before_size)
16328 return _before->get_substr_data(begin,size);
16329 elseif(begin>=_before_size)
16330 return _after->get_substr_data(begin-_before_size,size);
16331 else
16332 return base_t::get_substr_data(begin,size);
16333 }
16334 virtual void be_replace_as(ptr_t a)noexcept(clear_nothrow)override final{
16335 if(type_info<this_t> == typeid(*a)){
16336 const auto p = down_cast<this_t*>(a.get());
16337 if(_before_size==p->_before_size){
16338 if(_before!=p->_before)
16339 base_t::equivalent_optimization(_before, p->_before);
16340 if(_after!=p->_after)
16341 base_t::equivalent_optimization(_after, p->_after);
16342 }
16343 }
16344 _before.reset();
16345 _after.reset();
16346 base_t::be_replace_as(a);
16347 }
16348 [[nodiscard]]virtual size_t get_size()noexcept override final{ return _before_size+_after_size; }
16349 protected:
16350 virtual void copy_part_data_to(char_T* to,size_t pos,size_t size)noexcept(copy_assign_nothrow)override final{
16351 if(pos<_before_size){
16352 const auto copy_before_begin=pos;
16353 const auto copy_before_end=min(pos+size,_before_size);
16354 const auto copy_before_size=copy_before_end-copy_before_begin;
16355 _before->copy_part_data_to(to,copy_before_begin,copy_before_size);
16356 if(size!=copy_before_size){
16357 const auto copy_after_size=size-copy_before_size;
16358 to+=copy_before_size;
16359 _after->copy_part_data_to(to,0,copy_after_size);
16360 }
16361 }
16362 else
16363 _after->copy_part_data_to(to,pos-_before_size,size);
16364 }
16365 public:
16366 [[nodiscard]]virtual char_T arec(size_t index)noexcept(copy_construct_nothrow&&move_construct_nothrow)override final{
16367 if(index<_before_size)
16368 return _before->arec(index);
16369 else
16370 return _after->arec(index-_before_size);
16371 }
16372 virtual void arec_set(size_t index,char_T a,ptr_t& p)noexcept(copy_assign_nothrow&&move_construct_nothrow)override final{
16373 if(this->is_unique()){
16374 if(index<_before_size)
16375 _before->arec_set(index,a,_before);
16376 else
16377 _after->arec_set(index-_before_size,a,_after);
16378 self_changed();
16379 }
16380 else
16381 base_t::arec_set(index,a,p);
16382 }
16383 [[nodiscard]]virtual ptr_t apply_str_to_begin(string_view_t str)noexcept(copy_construct_nothrow&&apply_data_nothrow)override final{
16384 if(this->is_unique()){
16385 _before=_before->apply_str_to_begin(str);
16386 _before_size+=str.size();
16387 self_changed();
16388 return this;
16389 }
16390 else
16391 return base_t::apply_str_to_begin(str);
16392 }
16393 [[nodiscard]]virtual ptr_t apply_str_to_begin(ptr_t str)noexcept(apply_data_nothrow)override final{
16394 if(this->is_unique()){
16395 _before=_before->apply_str_to_begin(str);
16396 _before_size+=str->get_size();
16397 self_changed();
16398 return this;
16399 }
16400 else
16401 return base_t::apply_str_to_begin(str);
16402 }
16403 [[nodiscard]]virtual ptr_t apply_str_to_end(string_view_t str)noexcept(copy_construct_nothrow&&apply_data_nothrow)override final{
16404 if(this->is_unique()){
16405 _after=_after->apply_str_to_end(str);
16406 _after_size+=str.size();
16407 self_changed();
16408 return this;
16409 }
16410 else
16411 return base_t::apply_str_to_end(str);
16412 }
16413 [[nodiscard]]virtual ptr_t apply_str_to_end(ptr_t str)noexcept(apply_data_nothrow)override final{
16414 if(this->is_unique()){
16415 _after=_after->apply_str_to_end(str);
16416 _after_size+=str->get_size();
16417 self_changed();
16418 return this;
16419 }
16420 else
16421 return base_t::apply_str_to_end(str);
16422 }
16423 [[nodiscard]]virtual ptr_t do_pop_front(size_t size,ptr_t& self)noexcept(construct_nothrow&&copy_assign_nothrow)override final{
16424 if(this->is_unique() && _before_size>=size){
16425 ptr_t aret;
16426 if(_before_size==size)
16427 swap(aret,_before);
16428 else
16429 aret=_before->do_pop_front(size,_before);
16430 _before_size-=size;
16431 if(!_before_size)
16432 be_replace_as(_after);
16433 self_changed();
16434 return aret;
16435 }
16436 else
16437 return base_t::do_pop_front(size,self);
16438 }
16439 [[nodiscard]]virtual ptr_t do_pop_back(size_t size,ptr_t& self)noexcept(construct_nothrow&&copy_assign_nothrow)override final{
16440 if(this->is_unique() && _after_size>=size){
16441 ptr_t aret;
16442 if(_before_size==size)
16443 swap(aret,_after);
16444 else
16445 aret=_after->do_pop_back(size,_after);
16446 _after_size-=size;
16447 if(!_after_size)
16448 be_replace_as(_before);
16449 self_changed();
16450 return aret;
16451 }
16452 else
16453 return base_t::do_pop_back(size,self);
16454 }
16455 protected:
16456 virtual hash_t get_hash_detail(ptr_t&)noexcept(hash_nothrow)override final{
16457 suppress_msvc_warning(26494)//未初始化警告diss
16458 hash_t result;
16459 if(_before_size){
16460 result=_before->get_hash(_before);
16461 if(_after_size)
16462 result=hash.merge_array_hash_results(result,_before_size,_after->get_hash(_after),_after_size);
16463 }
16464 else
16465 result=_after->get_hash(_after);
16466 return result;
16467 }
16468 virtual hash_t get_others_hash_with_calculated_before_detail(hash_t before,size_t before_size,ptr_t&,size_t pos,size_t size)noexcept(hash_nothrow)override final{
16469 if(pos<_before_size){
16470 const auto calculate_before_begin=pos;
16471 const auto calculate_before_end=min(pos+size,_before_size);
16472 const auto calculate_before_size=calculate_before_end-calculate_before_begin;
16473 before=_before->get_others_hash_with_calculated_before(before,before_size,_before,calculate_before_begin,calculate_before_size);
16474 if(size!=calculate_before_size){
16475 const auto calculate_after_size=size-calculate_before_size;
16476 before_size+=calculate_before_size;
16477 before=_after->get_others_hash_with_calculated_before(before,before_size,_after,0,calculate_after_size);
16478 }
16479 }
16480 else
16481 before=_after->get_others_hash_with_calculated_before(before,before_size,_after,pos-_before_size,size);
16482 return before;
16483 }
16484 protected:
16485 [[nodiscard]]virtual bool same_struct(ptr_t with)noexcept override final{
16486 auto wp=down_cast<this_t*>(with.get());
16487 return _before_size==wp->_before_size;//总size被保证一样
16488 }
16489 [[nodiscard]]virtual range_t<const char_T*> get_the_largest_complete_data_block_begin_form(size_t begin)noexcept override final{
16490 if(begin < _before_size)
16491 return _before->get_the_largest_complete_data_block_begin_form(begin);
16492 else
16493 return _after->get_the_largest_complete_data_block_begin_form(begin - _before_size);
16494 }
16495 [[nodiscard]]virtual bool same_struct_equal(ptr_t with)noexcept(equal.nothrow<char_T>)override final{
16496 auto wp=down_cast<this_t*>(with.get());
16497 if(!this->_before->equal_with(wp->_before))
16498 return false;
16499 return this->_after->equal_with(wp->_after);
16500 }
16501 [[nodiscard]]virtual base_t::compare_type same_struct_compare(ptr_t with)noexcept(compare.nothrow<char_T>)override final{
16502 auto wp=down_cast<this_t*>(with.get());
16503 if(auto tmp=this->_before->compare_with(wp->_before); tmp!=0)
16504 return tmp;
16505 return this->_after->compare_with(wp->_after);
16506 }
16507 [[nodiscard]]virtual float_size_t get_base_memory_cost()noexcept override final{
16508 return float_size_of(*this)+_before->get_memory_cost()+_after->get_memory_cost();
16509 }
16510 };
16511 template<typename char_T>
16513 return get<sum_string_data_t<char_T>>(this,str);
16514 }
16515 template<typename char_T>
16517 return get<sum_string_data_t<char_T>>(str,this);
16518 }
16519
16520 //file_end
16521
16522 #line 24 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/string_data_t/_body.hpp"
16523
16524 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/string_data_t/erased_string_data_t.hpp"
16525 //erased_string_data_t.hpp
16526 //at namespace elc::defs::string_n::string_data_n
16527 /*
16528 未完成的elc解释器string文件
16529 由steve02081504与Alex0125设计、编写
16530 转载时请在不对此文件做任何修改的同时注明出处
16531 项目地址:https://github.com/steve02081504/ELC
16532 */
16533 template<typename char_T>
16534 struct erased_string_data_t final:base_string_data_t<char_T>,instance_struct<erased_string_data_t<char_T>>{
16537 using base_t::ptr_t;
16539 using base_t::self_changed;
16540
16541 using base_t::copy_assign_nothrow;
16542 using base_t::copy_construct_nothrow;
16543 using base_t::move_construct_nothrow;
16544 using base_t::construct_nothrow;
16545 using base_t::destruct_nothrow;
16546 using base_t::clear_nothrow;
16547 using base_t::ptr_reset_nothrow;
16548 using base_t::hash_nothrow;
16549 using base_t::get_data_nothrow;
16550 using base_t::apply_data_nothrow;
16551 using base_t::set_hash_cache;
16552
16554 size_t _to_size;
16557
16559 if(_to_size==_erase_size || !_to_size)
16560 be_replace_as(null_ptr);
16561 }
16562
16563 erased_string_data_t(ptr_t str,size_t erase_pos,size_t erase_size)noexcept:_to(str),_to_size(_to->get_size()),_erase_pos(erase_pos),_erase_size(erase_size){
16564 null_equivalent_check();
16565 }
16566
16567 [[nodiscard]]virtual ptr_t get_substr_data(size_t begin,size_t size)noexcept override final{
16568 if(begin+size<_erase_pos)
16569 return _to->get_substr_data(begin,size);
16570 elseif(begin>_erase_pos)
16571 return _to->get_substr_data(begin+_erase_size,size);
16572 else
16573 return base_t::get_substr_data(begin,size);
16574 }
16575 virtual void be_replace_as(ptr_t a)noexcept(clear_nothrow)override final {
16576 if(type_info<this_t> == typeid(*a)){
16577 const auto p = down_cast<this_t*>(a.get());
16578 if(_erase_pos==p->_erase_pos && _erase_size==p->_erase_size && _to!=p->_to)
16579 base_t::equivalent_optimization(_to, p->_to);
16580 }
16581 _to.reset();
16582 base_t::be_replace_as(a);
16583 }
16584 [[nodiscard]]virtual size_t get_size()noexcept override final{ return _to_size-_erase_size; }
16585 protected:
16586 virtual void copy_part_data_to(char_T* to,size_t pos,size_t size)noexcept(copy_assign_nothrow)override final{
16587 if(pos+size<_erase_pos)
16588 _to->copy_part_data_to(to,pos,size);
16589 elseif(pos>_erase_pos)
16590 _to->copy_part_data_to(to,pos+_erase_size,size);
16591 else{
16592 const auto size_before_erase_pos=_erase_pos-pos;
16593 const auto size_after_erase_pos=size-size_before_erase_pos;
16594 _to->copy_part_data_to(to,pos,size_before_erase_pos);
16595 _to->copy_part_data_to(to+size_before_erase_pos,_erase_pos+_erase_size,size_after_erase_pos);
16596 }
16597 }
16598 public:
16599 [[nodiscard]]virtual ptr_t do_erase(size_t pos,size_t size)noexcept override final{
16600 if(this->is_unique()){
16601 if(pos<=_erase_pos && pos+size>=_erase_pos+_erase_size){
16602 _erase_pos=pos;
16603 _erase_size+=size;
16604 self_changed();
16605 return this;
16606 }
16607 }
16608 return base_t::do_erase(pos,size);
16609 }
16610 [[nodiscard]]virtual char_T arec(size_t index)noexcept(copy_construct_nothrow&&move_construct_nothrow)override final{
16611 if(index>_erase_pos)
16612 return _to->arec(index+_erase_size);
16613 else
16614 return _to->arec(index);
16615 }
16616
16617 virtual void arec_set(size_t index,char_T a,ptr_t& p)noexcept(copy_assign_nothrow&&move_construct_nothrow)override final{
16618 if(this->is_unique()){
16619 if(index>_erase_pos)
16620 _to->arec_set(index+_erase_size,a,_to);
16621 else
16622 _to->arec_set(index,a,_to);
16623 self_changed();
16624 }
16625 else
16626 base_t::arec_set(index,a,p);
16627 }
16628 [[nodiscard]]virtual ptr_t apply_str_to_begin(string_view_t str)noexcept(copy_construct_nothrow&&apply_data_nothrow)override final{
16629 if(this->is_unique()){
16630 _to=_to->apply_str_to_begin(str);
16631 const auto strsize=str.size();
16632 _to_size+=strsize;
16633 _erase_pos+=strsize;
16634 self_changed();
16635 return this;
16636 }
16637 else
16638 return base_t::apply_str_to_begin(str);
16639 }
16640 [[nodiscard]]virtual ptr_t apply_str_to_begin(ptr_t str)noexcept(apply_data_nothrow)override final{
16641 if(this->is_unique()){
16642 _to=_to->apply_str_to_begin(str);
16643 const auto strsize=str->get_size();
16644 _to_size+=strsize;
16645 _erase_pos+=strsize;
16646 self_changed();
16647 return this;
16648 }
16649 else
16650 return base_t::apply_str_to_begin(str);
16651 }
16652 [[nodiscard]]virtual ptr_t apply_str_to_end(string_view_t str)noexcept(copy_construct_nothrow&&apply_data_nothrow)override final{
16653 if(this->is_unique()){
16654 _to=_to->apply_str_to_end(str);
16655 _to_size+=str.size();
16656 self_changed();
16657 return this;
16658 }
16659 else
16660 return base_t::apply_str_to_end(str);
16661 }
16662 [[nodiscard]]virtual ptr_t apply_str_to_end(ptr_t str)noexcept(apply_data_nothrow)override final{
16663 if(this->is_unique()){
16664 _to=_to->apply_str_to_end(str);
16665 _to_size+=str->get_size();
16666 self_changed();
16667 return this;
16668 }
16669 else
16670 return base_t::apply_str_to_end(str);
16671 }
16672 [[nodiscard]]virtual ptr_t do_pop_front(size_t size,ptr_t& self)noexcept(construct_nothrow&&copy_assign_nothrow)override final{
16673 if(this->is_unique() && _erase_pos > size){
16674 auto aret=_to->do_pop_front(size,_to);
16675 _to_size-=size;
16676 _erase_pos-=size;
16677 null_equivalent_check();
16678 self_changed();
16679 return aret;
16680 }
16681 else
16682 return base_t::do_pop_front(size,self);
16683 }
16684 [[nodiscard]]virtual ptr_t do_pop_back(size_t size,ptr_t& self)noexcept(construct_nothrow&&copy_assign_nothrow)override final{
16685 if(this->is_unique() && _erase_pos+_erase_size <= _to_size-size){
16686 auto aret=_to->do_pop_back(size,_to);
16687 _to_size-=size;
16688 null_equivalent_check();
16689 self_changed();
16690 return aret;
16691 }
16692 else
16693 return base_t::do_pop_back(size,self);
16694 }
16695 protected:
16696 virtual hash_t get_hash_detail(ptr_t&)noexcept(hash_nothrow)override final{
16697 auto result=hash(nothing);
16698 const auto size=get_size();
16699 const auto size_before_erase_pos=_erase_pos;
16700 const auto size_after_erase_pos=size-size_before_erase_pos;
16701 result=_to->get_others_hash_with_calculated_before(result,0,_to,0,size_before_erase_pos);
16702 result=_to->get_others_hash_with_calculated_before(result,size_before_erase_pos,_to,_erase_pos+_erase_size,size_after_erase_pos);
16703 return result;
16704 }
16705 virtual hash_t get_others_hash_with_calculated_before_detail(hash_t before,size_t before_size,ptr_t&,size_t pos,size_t size)noexcept(hash_nothrow)override final{
16706 if(pos+size<_erase_pos)
16707 before=_to->get_others_hash_with_calculated_before(before,before_size,_to,pos,size);
16708 elseif(pos>_erase_pos)
16709 before=_to->get_others_hash_with_calculated_before(before,before_size,_to,pos+_erase_size,size);
16710 else{
16711 const auto size_before_erase_pos=_erase_pos-pos;
16712 const auto size_after_erase_pos=size-size_before_erase_pos;
16713 before=_to->get_others_hash_with_calculated_before(before,before_size,_to,pos,size_before_erase_pos);
16714 before=_to->get_others_hash_with_calculated_before(before,before_size+size_before_erase_pos,_to,_erase_pos+_erase_size,size_after_erase_pos);
16715 }
16716 return before;
16717 }
16718 protected:
16719 [[nodiscard]]virtual bool same_struct(ptr_t with)noexcept override final{
16720 auto wp = down_cast<this_t*>(with.get());
16721 return _erase_pos == wp->_erase_pos && _erase_size == wp->_erase_size;
16722 }
16723 [[nodiscard]]virtual range_t<const char_T*> get_the_largest_complete_data_block_begin_form(size_t begin)noexcept override final{
16724 if(begin < _erase_pos){
16725 auto aret=_to->get_the_largest_complete_data_block_begin_form(begin);
16726 if(aret.size() > _erase_pos){
16727 aret = {aret.begin(),_erase_pos};
16728 }
16729 return aret;
16730 }
16731 else
16732 return _to->get_the_largest_complete_data_block_begin_form(begin + _erase_size);
16733 }
16734 [[nodiscard]]virtual bool same_struct_equal(ptr_t with)noexcept(equal.nothrow<char_T>)override final{
16735 auto wp=down_cast<this_t*>(with.get());
16736 if(!_to->equal_with(wp->_to,0,_erase_pos))
16737 return false;
16738 return _to->equal_with(wp->_to,_erase_pos+_erase_size,_to_size);
16739 }
16740 [[nodiscard]]virtual base_t::compare_type same_struct_compare(ptr_t with)noexcept(compare.nothrow<char_T>)override final{
16741 auto wp=down_cast<this_t*>(with.get());
16742 if(auto tmp=_to->compare_with(wp->_to,0,_erase_pos); tmp!=0)
16743 return tmp;
16744 return _to->compare_with(wp->_to,_erase_pos+_erase_size,_to_size);
16745 }
16746 [[nodiscard]]virtual float_size_t get_base_memory_cost()noexcept override final{
16747 return float_size_of(*this)+_to->get_memory_cost();
16748 }
16749 };
16750 template<typename char_T>
16752 if(size==get_size())
16753 return null_ptr;
16754 else
16755 return get<erased_string_data_t<char_T>>(this,pos,size);
16756 }
16757
16758 //file_end
16759
16760 #line 26 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/string_data_t/_body.hpp"
16761 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/string_data_t/inserted_string_data_t.hpp"
16762 //inserted_string_data_t.hpp
16763 //at namespace elc::defs::string_n::string_data_n
16764 /*
16765 未完成的elc解释器string文件
16766 由steve02081504与Alex0125设计、编写
16767 转载时请在不对此文件做任何修改的同时注明出处
16768 项目地址:https://github.com/steve02081504/ELC
16769 */
16770 template<typename char_T>
16771 struct inserted_string_data_t final: base_string_data_t<char_T>,instance_struct<inserted_string_data_t<char_T>>{
16774 using base_t::ptr_t;
16776 using base_t::self_changed;
16777
16778 using base_t::copy_assign_nothrow;
16779 using base_t::copy_construct_nothrow;
16780 using base_t::move_construct_nothrow;
16781 using base_t::construct_nothrow;
16782 using base_t::destruct_nothrow;
16783 using base_t::clear_nothrow;
16784 using base_t::ptr_reset_nothrow;
16785 using base_t::hash_nothrow;
16786 using base_t::get_data_nothrow;
16787 using base_t::apply_data_nothrow;
16788 using base_t::set_hash_cache;
16789
16792 size_t _to_size;
16795
16796 inserted_string_data_t(ptr_t to,ptr_t insert_data,size_t insert_pos)noexcept:_to(to),_insert_data(insert_data),_insert_pos(insert_pos),_to_size(to->get_size()),_insert_size(insert_data->get_size()){}
16797
16798 [[nodiscard]]virtual ptr_t get_substr_data(size_t begin,size_t size)noexcept override final{
16799 if(begin+size<_insert_pos)
16800 return _to->get_substr_data(begin,size);
16801 elseif(begin>_insert_pos+_insert_size)
16802 return _to->get_substr_data(begin-_insert_size,size);
16803 elseif(begin>=_insert_pos && begin+size<=_insert_pos+_insert_size)
16804 return _insert_data->get_substr_data(begin-_insert_pos,size);
16805 else
16806 return base_t::get_substr_data(begin,size);
16807 }
16808 virtual void be_replace_as(ptr_t a)noexcept(clear_nothrow)override final{
16809 if(type_info<this_t> == typeid(*a)){
16810 const auto p = down_cast<this_t*>(a.get());
16811 if(_insert_pos==p->_insert_pos && _insert_size==p->_insert_size){
16812 if(_to!=p->_to)
16813 base_t::equivalent_optimization(_to, p->_to);
16814 if(_insert_data!=p->_insert_data)
16815 base_t::equivalent_optimization(_insert_data, p->_insert_data);
16816 }
16817 }
16818 _to.reset();
16819 _insert_data.reset();
16820 base_t::be_replace_as(a);
16821 }
16822 [[nodiscard]]virtual size_t get_size()noexcept override final{ return _to_size+_insert_size; }
16823 protected:
16824 virtual void copy_part_data_to(char_T* to,size_t pos,size_t size)noexcept(copy_assign_nothrow)override final{
16825 if(pos+size<_insert_pos)
16826 _to->copy_part_data_to(to,pos,size);
16827 elseif(pos>_insert_pos+_insert_size)
16828 _to->copy_part_data_to(to,pos-_insert_size,size);
16829 else{
16830 if(_insert_pos>pos){
16831 auto size_before_insert_pos=_insert_pos-pos;
16832 _to->copy_part_data_to(to,pos,size_before_insert_pos);
16833 to+=size_before_insert_pos;
16834 size-=size_before_insert_pos;
16835 }
16836 auto size_before_insert_end=min(size,_insert_size);
16837 _insert_data->copy_part_data_to(to,0,size_before_insert_end);
16838 to+=size_before_insert_end;
16839 size-=size_before_insert_end;
16840 if(size)
16841 _to->copy_part_data_to(to,_insert_pos,size);
16842 }
16843 }
16844 public:
16845 [[nodiscard]]virtual ptr_t do_insert(size_t pos,string_view_t str)noexcept(copy_construct_nothrow)override final{
16846 if(this->is_unique()){
16847 if(pos>=_insert_pos && pos<=_insert_pos+_insert_size){
16848 _insert_data=_insert_data->do_insert(pos-_insert_pos,str);
16849 _insert_size+=str.size();
16850 }
16851 elseif(pos<_insert_pos){
16852 _to=_to->do_insert(pos,str);
16853 _to_size+=str.size();
16854 _insert_pos+=str.size();
16855 }
16856 elseif(pos>_insert_pos+_insert_size){
16857 _to=_to->do_insert(pos-_insert_size,str);
16858 _to_size+=str.size();
16859 }
16860 self_changed();
16861 return this;
16862 }
16863 return base_t::do_insert(pos,str);
16864 }
16865 [[nodiscard]]virtual ptr_t do_erase(size_t pos,size_t size)noexcept override final{
16866 if(this->is_unique()){
16867 if(pos>=_insert_pos && pos+size<=_insert_pos+_insert_size){
16868 _insert_data=_insert_data->do_erase(pos-_insert_pos,size);
16869 _insert_size-=size;
16870 self_changed();
16871 return this;
16872 }
16873 elseif(pos+size<_insert_pos){
16874 _to=_to->do_erase(pos,size);
16875 _to_size-=size;
16876 _insert_pos-=size;
16877 self_changed();
16878 return this;
16879 }
16880 elseif(pos>_insert_pos+_insert_size){
16881 _to=_to->do_erase(pos-_insert_size,size);
16882 _to_size-=size;
16883 self_changed();
16884 return this;
16885 }
16886 }
16887 return base_t::do_erase(pos,size);
16888 }
16889 [[nodiscard]]virtual char_T arec(size_t index)noexcept(copy_construct_nothrow&&move_construct_nothrow)override final{
16890 if(index>=_insert_pos && index<_insert_pos+_insert_size)
16891 return _insert_data->arec(index-_insert_pos);
16892 elseif(index>=_insert_pos+_insert_size)
16893 return _to->arec(index-_insert_size);
16894 else
16895 return _to->arec(index);
16896 }
16897
16898 virtual void arec_set(size_t index,char_T a,ptr_t& p)noexcept(copy_assign_nothrow&&move_construct_nothrow)override final{
16899 if(this->is_unique()){
16900 if(index>=_insert_pos && index<_insert_pos+_insert_size)
16901 _insert_data->arec_set(index-_insert_pos,a,p);
16902 elseif(index>=_insert_pos+_insert_size)
16903 _to->arec_set(index-_insert_size,a,p);
16904 else
16905 _to->arec_set(index,a,p);
16906 self_changed();
16907 }
16908 else
16909 base_t::arec_set(index,a,p);
16910 }
16911 [[nodiscard]]virtual ptr_t apply_str_to_begin(string_view_t str)noexcept(copy_construct_nothrow&&apply_data_nothrow)override final{
16912 if(this->is_unique()){
16913 const auto size=str.size();
16914 if(_insert_pos==0){
16915 _insert_data=_insert_data->apply_str_to_begin(str);
16916 _insert_size+=size;
16917 }
16918 else{
16919 _to=_to->apply_str_to_begin(str);
16920 _to_size+=str.size();
16921 _insert_pos+=size;
16922 }
16923 self_changed();
16924 return this;
16925 }
16926 else
16927 return base_t::apply_str_to_begin(str);
16928 }
16929 [[nodiscard]]virtual ptr_t apply_str_to_begin(ptr_t str)noexcept(apply_data_nothrow)override final{
16930 if(this->is_unique()){
16931 const auto size=str->get_size();
16932 if(_insert_pos==0){
16933 _insert_data=_insert_data->apply_str_to_begin(str);
16934 _insert_size+=size;
16935 }
16936 else{
16937 _to=_to->apply_str_to_begin(str);
16938 _to_size+=str->get_size();
16939 _insert_pos+=size;
16940 }
16941 self_changed();
16942 return this;
16943 }
16944 else
16945 return base_t::apply_str_to_begin(str);
16946 }
16947 [[nodiscard]]virtual ptr_t apply_str_to_end(string_view_t str)noexcept(copy_construct_nothrow&&apply_data_nothrow)override final{
16948 if(this->is_unique()){
16949 if(_insert_pos==_to_size){
16950 _insert_data=_insert_data->apply_str_to_end(str);
16951 _insert_size+=str.size();
16952 }
16953 else{
16954 _to=_to->apply_str_to_end(str);
16955 _to_size+=str.size();
16956 }
16957 self_changed();
16958 return this;
16959 }
16960 else
16961 return base_t::apply_str_to_end(str);
16962 }
16963 [[nodiscard]]virtual ptr_t apply_str_to_end(ptr_t str)noexcept(apply_data_nothrow)override final{
16964 if(this->is_unique()){
16965 if(_insert_pos==_to_size){
16966 _insert_data=_insert_data->apply_str_to_end(str);
16967 _insert_size+=str->get_size();
16968 }
16969 else{
16970 _to=_to->apply_str_to_end(str);
16971 _to_size+=str->get_size();
16972 }
16973 self_changed();
16974 return this;
16975 }
16976 else
16977 return base_t::apply_str_to_end(str);
16978 }
16979 [[nodiscard]]virtual ptr_t do_pop_front(size_t size,ptr_t& self)noexcept(construct_nothrow&&copy_assign_nothrow)override final{
16980 if(this->is_unique()){
16981 if(_insert_pos > size){
16982 auto aret=_to->do_pop_front(size,_to);
16983 _to_size-=size;
16984 _insert_pos-=size;
16985 self_changed();
16986 return aret;
16987 }
16988 elseif(_insert_pos==0 && _insert_size>=size){
16989 auto aret=_insert_data->do_pop_front(size,_insert_data);
16990 _insert_size-=size;
16991 self_changed();
16992 return aret;
16993 }
16994 }
16995 return base_t::do_pop_front(size,self);
16996 }
16997 [[nodiscard]]virtual ptr_t do_pop_back(size_t size,ptr_t& self)noexcept(construct_nothrow&&copy_assign_nothrow)override final{
16998 if(this->is_unique()){
16999 if(_insert_pos+_insert_size <= _to_size-size){
17000 auto aret=_to->do_pop_back(size,_to);
17001 _to_size-=size;
17002 self_changed();
17003 return aret;
17004 }
17005 elseif(_insert_pos==_to_size && _insert_size>=size){
17006 auto aret=_insert_data->do_pop_front(size,_insert_data);
17007 _insert_size-=size;
17008 self_changed();
17009 return aret;
17010 }
17011 }
17012 return base_t::do_pop_back(size,self);
17013 }
17014 protected:
17015 virtual hash_t get_hash_detail(ptr_t&)noexcept(hash_nothrow)override final{
17016 auto result=hash(nothing);
17017 if(_insert_pos){
17018 result=_to->get_others_hash_with_calculated_before(result,0,_to,0,_insert_pos);
17019 }
17020 result=hash.merge_array_hash_results(result,_insert_pos,_insert_data->get_hash(_insert_data),_insert_size);
17021 const auto size=_to_size-_insert_pos;
17022 if(size)
17023 result=_to->get_others_hash_with_calculated_before(result,_insert_pos+_insert_size,_to,_insert_pos,size);
17024 return result;
17025 }
17026 virtual hash_t get_others_hash_with_calculated_before_detail(hash_t before,size_t before_size,ptr_t&,size_t pos,size_t size)noexcept(hash_nothrow)override final{
17027 if(pos+size<_insert_pos)
17028 before=_to->get_others_hash_with_calculated_before(before,before_size,_to,pos,size);
17029 elseif(pos>_insert_pos+_insert_size)
17030 before=_to->get_others_hash_with_calculated_before(before,before_size,_to,pos-_insert_size,size);
17031 else{
17032 if(_insert_pos>pos){
17033 const auto size_before_insert_pos=_insert_pos-pos;
17034 before=_to->get_others_hash_with_calculated_before(before,before_size,_to,pos,size_before_insert_pos);
17035 size-=size_before_insert_pos;
17036 before_size+=size_before_insert_pos;
17037 }
17038 auto size_before_insert_end=min(size,_insert_size);
17039 before=_insert_data->get_others_hash_with_calculated_before(before,before_size,_insert_data,0,size_before_insert_end);
17040 size-=size_before_insert_end;
17041 before_size+=size_before_insert_end;
17042 if(size)
17043 before=_to->get_others_hash_with_calculated_before(before,before_size,_to,_insert_pos,size);
17044 }
17045 return before;
17046 }
17047 protected:
17048 [[nodiscard]]virtual bool same_struct(ptr_t with)noexcept override final{
17049 auto wp=down_cast<this_t*>(with.get());
17050 return _insert_pos==wp->_insert_pos && _insert_size==wp->_insert_size;//总size被保证一样
17051 }
17052 [[nodiscard]]virtual range_t<const char_T*> get_the_largest_complete_data_block_begin_form(size_t index)noexcept override final{
17053 if(index>=_insert_pos && index<_insert_pos+_insert_size)
17054 return _insert_data->get_the_largest_complete_data_block_begin_form(index-_insert_pos);
17055 elseif(index>=_insert_pos+_insert_size)
17056 return _to->get_the_largest_complete_data_block_begin_form(index-_insert_size);
17057 else {
17058 auto aret=_to->get_the_largest_complete_data_block_begin_form(index);
17059 if(aret.size()+index > _insert_pos)
17060 aret = {aret.begin(), note::size(_insert_pos-index)};
17061 return aret;
17062 }
17063 }
17064 [[nodiscard]]virtual bool same_struct_equal(ptr_t with)noexcept(equal.nothrow<char_T>)override final{
17065 auto wp=down_cast<this_t*>(with.get());
17066 if(!_insert_data->equal_with(wp->_insert_data))
17067 return false;
17068 return _to->equal_with(wp->_to);
17069 }
17070 [[nodiscard]]virtual base_t::compare_type same_struct_compare(ptr_t with)noexcept(compare.nothrow<char_T>)override final{
17071 auto wp=down_cast<this_t*>(with.get());
17072 if(auto tmp=_to->compare_with(wp->_to,0,_insert_pos); tmp!=0)
17073 return tmp;
17074 if(auto tmp=_insert_data->compare_with(wp->_insert_data); tmp!=0)
17075 return tmp;
17076 return _to->compare_with(wp->_to,_insert_pos,_to_size-(_insert_pos+_insert_size));
17077 }
17078 [[nodiscard]]virtual float_size_t get_base_memory_cost()noexcept override final{
17079 return float_size_of(*this)+_insert_data->get_memory_cost()+_to->get_memory_cost();
17080 }
17081 };
17082 template<typename char_T>
17084 return get<inserted_string_data_t<char_T>>(this,str,pos);
17085 }
17086 template<typename char_T>
17088 if(pos==0)
17089 return this->apply_str_to_begin(str);
17090 elseif(pos==get_size())
17091 return this->apply_str_to_end(str);
17092 else
17093 return this->do_insert(pos,get<comn_string_data_t<char_T>>(str));
17094 }
17095
17096 //file_end
17097
17098 #line 27 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/string_data_t/_body.hpp"
17099
17100 //#include "replaced_string_data_t.hpp"
17101
17102 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/string_data_t/same_value_compress_string_data_t.hpp"
17103 //sum_string_data_t.hpp
17104 //at namespace elc::defs::string_n::string_data_n
17105 /*
17106 未完成的elc解释器string文件
17107 由steve02081504与Alex0125设计、编写
17108 转载时请在不对此文件做任何修改的同时注明出处
17109 项目地址:https://github.com/steve02081504/ELC
17110 */
17111 template<typename char_T>
17112 struct same_value_compress_string_data_t final:base_string_data_t<char_T>,instance_struct<same_value_compress_string_data_t<char_T>>{
17115 using base_t::ptr_t;
17117 using base_t::self_changed;
17118
17119 using base_t::copy_assign_nothrow;
17120 using base_t::copy_construct_nothrow;
17121 using base_t::move_construct_nothrow;
17122 using base_t::construct_nothrow;
17123 using base_t::destruct_nothrow;
17124 using base_t::clear_nothrow;
17125 using base_t::ptr_reset_nothrow;
17126 using base_t::hash_nothrow;
17127 using base_t::get_data_nothrow;
17128 using base_t::apply_data_nothrow;
17129 using base_t::set_hash_cache;
17130
17131 size_t _size;
17132 char_T _value;
17133
17134 same_value_compress_string_data_t(size_t size,char_T value)noexcept:_size(size),_value(value){}
17135
17136 virtual void be_replace_as(ptr_t a)noexcept(clear_nothrow)override final{
17137 base_t::be_replace_as(a);
17138 }
17139 [[nodiscard]]virtual ptr_t get_substr_data([[maybe_unused]]size_t begin,size_t size)noexcept override final{
17140 return get<same_value_compress_string_data_t<char_T>>(size,_value);
17141 }
17142 [[nodiscard]]virtual size_t get_size()noexcept override final{ return _size; }
17143 protected:
17144 virtual void copy_part_data_to(char_T* to,[[maybe_unused]]size_t pos,size_t size)noexcept(copy_assign_nothrow)override final{
17145 copy_assign[size](_value,note::to(to));
17146 }
17147 public:
17148 [[nodiscard]]virtual char_T arec([[maybe_unused]]size_t index)noexcept(copy_construct_nothrow&&move_construct_nothrow)override final{
17149 return _value;
17150 }
17151 virtual void arec_set(size_t index,char_T a,ptr_t& p)noexcept(copy_assign_nothrow&&move_construct_nothrow)override final{
17152 base_t::arec_set(index,a,p);
17153 }
17154 [[nodiscard]]virtual ptr_t do_pop_front(size_t size,ptr_t&)noexcept(construct_nothrow&&copy_assign_nothrow)override final{
17155 if(this->is_unique()){
17156 _size-=size;
17157 self_changed();
17158 return this;
17159 }
17160 else
17161 return get<same_value_compress_string_data_t<char_T>>(_size-size,_value);
17162 }
17163 [[nodiscard]]virtual ptr_t do_pop_back(size_t size,ptr_t&)noexcept(construct_nothrow&&copy_assign_nothrow)override final{
17164 if(this->is_unique()){
17165 _size-=size;
17166 self_changed();
17167 return this;
17168 }
17169 else
17170 return get<same_value_compress_string_data_t<char_T>>(_size-size,_value);
17171 }
17172 protected:
17173 virtual hash_t get_hash_detail(ptr_t&)noexcept(hash_nothrow)override final{
17174 return hash.repeat_times(_value,_size);
17175 }
17176 virtual hash_t get_others_hash_with_calculated_before_detail(hash_t before,size_t before_size,ptr_t&,[[maybe_unused]]size_t pos,size_t size)noexcept(hash_nothrow)override final{
17177 return hash.merge_array_hash_results(before,before_size,hash.repeat_times(_value,size),size);
17178 }
17179 protected:
17180 [[nodiscard]]virtual bool same_struct(ptr_t with)noexcept override final{
17181 return true;//总size被保证一样
17182 }
17183 [[nodiscard]]virtual range_t<const char_T*> get_the_largest_complete_data_block_begin_form([[maybe_unused]]size_t begin)noexcept override final{
17184 if constexpr(construct<char_T>.trivial<const char_T&> && destruct.trivial<char_T>){
17185 constexpr size_t data_size=512;
17186 static char_T data[data_size];
17187 if(data[0]!=_value)
17188 copy_assign[data_size](_value,note::to(data));
17189 return {data,note::size(min(_size-begin,data_size))};
17190 }
17191 else
17192 return {&_value,note::size<size_t>(1)};
17193 }
17194 [[nodiscard]]virtual bool same_struct_equal(ptr_t with)noexcept(equal.nothrow<char_T>)override final{
17195 auto wp=down_cast<this_t*>(with.get());
17196 return equal(_value,wp->_value);
17197 }
17198 [[nodiscard]]virtual base_t::compare_type same_struct_compare(ptr_t with)noexcept(compare.nothrow<char_T>)override final{
17199 auto wp=down_cast<this_t*>(with.get());
17200 return compare(_value,wp->_value);
17201 }
17202 [[nodiscard]]virtual float_size_t get_base_memory_cost()noexcept override final{
17203 return float_size_of(*this);
17204 }
17205 };
17206
17207 //file_end
17208
17209 #line 31 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/string_data_t/_body.hpp"
17210 }
17211
17212 //file_end
17213
17214 #line 10 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/defs.hpp"
17215 template<typename char_T>
17216 struct string_t{
17217 static_assert(type_info<char_T> != type_info<const char_T>);
17218
17220 typedef base_t_w::ptr_t ptr_t;
17221 typedef base_t_w::string_view_t string_view_t;
17224 typedef char_T value_type;
17226 typedef size_t size_type;
17227 static constexpr size_t npos = range_n::npos;
17228
17229 private:
17230 //_cso_info用于存储不同cso情况下string所用到的数据
17231 mutable union _cso_info_t{
17232 ptr_t _mptr;
17233 const constexpr_str_t* _str;
17234 char_T _ch;
17235
17236 push_and_disable_msvc_warning(26495);//未初始化警告diss
17237 constexpr _cso_info_t()noexcept{}
17238 constexpr _cso_info_t(const _cso_info_t&a)noexcept{
17239 copy_assign[sizeof(_cso_info_t)](cast_to_data(this),cast_to_data(&a));
17240 }
17242 constexpr void operator=(const _cso_info_t&a)noexcept{
17243 copy_assign[sizeof(_cso_info_t)](cast_to_data(this),cast_to_data(&a));
17244 }
17245 ~_cso_info_t()noexcept{}
17246 }_cso_info{};
17247 //_cso_flags用于标识不同的cso情况
17248 mutable struct _cso_flags_t{
17249 bool _cso_flag=0;
17250 bool _str_cso_flag=0;
17251 }_cso_flags;
17252
17253 //非cso情况下的成员宏,表示一个指向string data的智能指针
17254 #define _m _cso_info._mptr
17255
17256 //BLOCK: 对成员宏`_m`的生命周期手动管理的函数族
17257
17258 //结束成员宏`_m`的生命周期
17259 constexpr void _ncso_destruct_mptr()const noexcept{destruct(&_m);}
17260 //开始成员宏`_m`的生命周期
17261 constexpr void _ncso_construct_mptr()const noexcept{construct<ptr_t>[&_m]();}
17262 //以特定初始值开始成员宏`_m`的生命周期
17263 constexpr void _ncso_construct_mptr(ptr_t p)const noexcept{construct<ptr_t>[&_m](p);}
17264
17265 //END_BLOCK
17266
17267 //BLOCK: cso情况判断函数族
17268 [[nodiscard]]bool _in_cso()const noexcept{return _cso_flags._cso_flag;}
17269 [[nodiscard]]bool _in_str_cso()const noexcept{return _in_cso() && _cso_flags._str_cso_flag;}
17270 [[nodiscard]]bool _in_chr_cso()const noexcept{return _in_cso() && !_cso_flags._str_cso_flag;}
17271 //END_BLOCK
17272 //BLOCK: cso情况设定函数族
17273 constexpr void _set_str_cso()const noexcept{_cso_flags._cso_flag=1;_cso_flags._str_cso_flag=1;}
17274 constexpr void _set_chr_cso()const noexcept{_cso_flags._cso_flag=1;_cso_flags._str_cso_flag=0;}
17275 constexpr void _set_not_cso()const noexcept{_cso_flags._cso_flag=0;}
17276 //END_BLOCK
17277
17278 //BLOCK: cso情况下的信息获取函数族
17279 [[nodiscard]]const char_T* _get_cso_data()const noexcept{return _in_str_cso()?_cso_info._str->str():&_cso_info._ch;}
17280 [[nodiscard]]size_t _get_cso_size()const noexcept{return _in_str_cso()?_cso_info._str->size():1;}
17281 [[nodiscard]]hash_t _get_cso_hash()const noexcept{return _in_str_cso()?hash(_get_cso_constexpr_str()):hash(_cso_info._ch);}
17282 [[nodiscard]]constexpr_str_t& _get_cso_constexpr_str()const noexcept{return *_cso_info._str;}
17283 //END_BLOCK
17284
17285 //BLOCK: cso情况管理函数族
17286 constexpr void _cso_init(constexpr_str_t&str)noexcept{_set_str_cso();_cso_info._str=&str;}
17287 constexpr void _cso_reinit(constexpr_str_t&str)noexcept{if(!_in_cso())_ncso_destruct_mptr();_cso_init(str);}
17288 constexpr void _cso_init(char_T ch)noexcept{_set_chr_cso();_cso_info._ch=ch;}
17289 constexpr void _cso_reinit(char_T ch)noexcept{if(!_in_cso())_ncso_destruct_mptr();_cso_init(ch);}
17290 void _cso_fin(bool need_write)const noexcept{
17291 if(_in_str_cso()&&!need_write)
17292 _ncso_construct_mptr(get<constexpr_string_data_t<char_T>>(*_cso_info._str));
17293 else{
17294 auto str=string_view_t{_get_cso_data(),_get_cso_size()};
17295 _ncso_construct_mptr(get<comn_string_data_t<char_T>>(str));
17296 }
17297 _set_not_cso();
17298 }
17299 void _cso_fin(ptr_t p)noexcept{
17300 _set_not_cso();
17301 _ncso_construct_mptr(p);
17302 }
17303 //END_BLOCK
17304
17305 //BLOCK: 已知需要拷贝cso全部内容,判断是否值得结束cso的检查
17306 static constexpr bool the_size_worth_to_end_cso(size_t size)noexcept{
17307 constexpr auto max_size=max(sizeof(comn_string_data_t<char_T>)*2/sizeof(char_T),(size_t)1);
17308 return size>=max_size;
17309 }
17310 static void full_copy_cso_check(const string_t&str)noexcept{
17311 if(the_size_worth_to_end_cso(str.size()))
17312 str._cso_check();
17313 }
17314 //END_BLOCK
17315
17316 //若cso,结束它
17317 void _cso_check(bool need_write=0)const noexcept{
17318 if(_in_cso())
17319 _cso_fin(need_write);
17320 }
17321
17322 //便利用,内部使用的构造函数
17323 string_t(ptr_t str)noexcept{_ncso_construct_mptr(str);}
17324 //无论是否在cso中,都保证可以获得一个ptr
17325 [[nodiscard]]ptr_t ptr_copy()const noexcept{
17326 _cso_check();
17327 return _m;
17328 }
17329 public:
17330 //swap的内部实现
17331 void swap_with(this_t& a)noexcept{
17332 if(_in_cso()||a._in_cso()){
17333 swap(_cso_info,a._cso_info);
17334 swap(_cso_flags,a._cso_flags);
17335 }
17336 else
17337 swap(_m,a._m);
17338 }
17339
17340 //BLOCK: 构造函数
17341 constexpr string_t()noexcept:string_t(empty_constexpr_str_of<char_T>){}
17342 constexpr string_t(constexpr_str_t&str)noexcept{_cso_init(str);}
17343 string_t(string_view_t str)noexcept{_ncso_construct_mptr(get<comn_string_data_t<char_T>>(str));}
17344 string_t(const char_T* str)noexcept:string_t(string_view_t(str)){}
17345 constexpr string_t(char_T ch)noexcept{_cso_init(ch);}
17346 string_t(const string_t& str)noexcept{
17347 if(str._in_cso()){
17348 _cso_info=str._cso_info;
17349 _cso_flags=str._cso_flags;
17350 }
17351 else
17352 _ncso_construct_mptr(str._m);
17353 }
17354 string_t(string_t&& str)noexcept:string_t(){
17355 swap_with(str);
17356 }
17357 string_t(size_t size,char_T ch)noexcept{_ncso_construct_mptr(get<same_value_compress_string_data_t<char_T>>(size,ch));}
17358 string_t(char_T ch,size_t size)noexcept requires(type_info<size_t>!=type_info<char_T>):string_t(size,ch){}
17359
17360 string_t(size_t size)noexcept{_ncso_construct_mptr(get<comn_string_data_t<char_T>>(size));}
17361 //END_BLOCK
17362 //析构函数
17363 ~string_t()noexcept{if(!_in_cso())_ncso_destruct_mptr();}
17364
17365 //BLOCK: 赋值操作符
17366 string_t& operator=(const string_t& str)noexcept{re_construct[this](str);return*this;}
17367 string_t& operator=(string_t&& str)noexcept{swap_with(str);return*this;}
17368 constexpr string_t& operator=(constexpr_str_t&str)noexcept{_cso_reinit(str);return*this;}
17369 constexpr string_t& operator=(char_T ch)noexcept{_cso_reinit(ch);return*this;}
17370 //END_BLOCK
17371
17372 //BLOCK: 字符串相加操作符
17373 [[nodiscard]]string_t operator+(const string_t& str)const noexcept{
17374 full_copy_cso_check(str);
17375 if(str._in_cso())
17376 return operator+(str.to_string_view_t());
17377 else
17378 return ptr_copy()->apply_str_to_end(str._m);
17379 }
17380 [[nodiscard]]string_t operator+(string_view_t str)const noexcept{
17381 return ptr_copy()->apply_str_to_end(str);
17382 }
17383 [[nodiscard]]string_t operator+(const char_T* str)const noexcept{
17384 return *this+string_view_t(str);
17385 }
17386 friend [[nodiscard]]string_t operator+(string_view_t str1,const string_t& str2)noexcept{
17387 return str2.ptr_copy()->apply_str_to_begin(str1);
17388 }
17389 friend [[nodiscard]]string_t operator+(const char_T* str1,const string_t& str2)noexcept{
17390 return string_view_t(str1)+str2;
17391 }
17392 friend [[nodiscard]]string_t operator+(char_T ch,const string_t& str)noexcept{
17393 return string_view_t{&ch,1}+str;
17394 }
17395
17396 string_t& operator+=(const string_t&str)&noexcept{
17397 push_back(str);
17398 return *this;
17399 }
17401 push_back(str);
17402 return *this;
17403 }
17404 string_t& operator+=(const char_T* str)&noexcept{
17405 return *this+=string_view_t(str);
17406 }
17407 string_t& operator+=(char_T ch)&noexcept{
17408 return *this += string_view_t{&ch,1};
17409 }
17410 template<typename U>
17411 [[nodiscard]]string_t&& operator+(U&& b)&&noexcept_as(*this+=b) requires was_not_an_ill_form(*this+=b){ //对右值的operator+优化为operator+=
17412 *this+=b;
17413 return move(*this);
17414 }
17415 //END_BLOCK
17416
17417 //获取string占用的内存大小
17418 float_size_t memory_cost()const noexcept{
17419 if(_in_cso())
17420 return 0;
17421 else
17422 return _m->get_memory_cost();
17423 }
17424 public:
17425 //BLOCK: 比较运算符
17426 [[nodiscard]]constexpr auto operator<=>(const string_t& a)const noexcept(compare.nothrow<char_T>){
17427 if(a._in_str_cso())
17428 return operator<=>(a._get_cso_constexpr_str());
17429 elseif(a._in_cso())
17430 return operator<=>(a.to_string_view_t());
17431 auto ssize = size();
17432 auto scom = compare(ssize,a.size());//先比较大小,若需要再调用data
17433 if(scom==0){//大小相等
17434 if(!_in_cso())
17435 return _m->compare_with(a._m);
17436 elseif(_in_str_cso())
17437 return compare.reverse(a<=>_get_cso_constexpr_str());
17438 elseif(_in_cso())
17439 return compare.reverse(a<=>to_string_view_t());
17440 }
17441 return scom;
17442 }
17443 [[nodiscard]]constexpr auto operator==(const string_t& a)const noexcept(equal.nothrow<char_T>){
17444 if(a._in_str_cso())
17445 return operator==(a._get_cso_constexpr_str());
17446 elseif(a._in_cso())
17447 return operator==(a.to_string_view_t());
17448 auto ssize = size();
17449 const auto seq = equal(ssize,a.size());//先比较大小,若需要再调用data
17450 if(seq){//大小相等
17451 if(!_in_cso())
17452 return _m->equal_with(a._m);
17453 elseif(_in_str_cso())
17454 return a==_get_cso_constexpr_str();
17455 elseif(_in_cso())
17456 return a==to_string_view_t();
17457 }
17458 return seq;
17459 }
17460 [[nodiscard]]constexpr auto operator<=>(string_view_t a)const noexcept(compare.nothrow<char_T>){
17461 auto ssize = size();
17462 auto scom = compare(ssize,a.size());//先比较大小,若需要再调用data
17463 if(scom==0){
17464 if(_in_cso())
17465 return compare(data(),a.begin(),ssize);
17466 else
17467 return _m->compare_with(a);
17468 }
17469 return scom;
17470 }
17471 [[nodiscard]]constexpr auto operator==(string_view_t a)const noexcept(equal.nothrow<char_T>){
17472 auto ssize = size();
17473 const auto seq = equal(ssize,a.size());//先比较大小,若需要再调用data
17474 if(seq){
17475 if(_in_cso())
17476 return equal(data(),a.begin(),ssize);
17477 else
17478 return _m->equal_with(a);
17479 }
17480 return seq;
17481 }
17482 [[nodiscard]]constexpr auto operator<=>(constexpr_str_t&a)const noexcept(compare.nothrow<char_T>){
17483 if(_in_cso() && data()==a.str())//同起始优化
17484 return strong_ordering::equivalent;
17485 auto tmp=operator<=>((string_view_t&)a);
17486 if(tmp==0)
17487 remove_const(this)->_cso_reinit(a);
17488 return tmp;
17489 }
17490 [[nodiscard]]constexpr auto operator==(constexpr_str_t&a)const noexcept(equal.nothrow<char_T>){
17491 if(_in_cso() && data()==a.str())//同起始优化
17492 return true;
17493 const auto tmp=operator==((string_view_t&)a);
17494 if(tmp)
17495 remove_const(this)->_cso_reinit(a);
17496 return tmp;
17497 }
17498 [[nodiscard]]constexpr auto operator<=>(const char_T* a)const noexcept(compare.nothrow<char_T>){
17499 if(_in_cso())
17500 return compare(data(),size(),a,end_by_zero);
17501 else
17502 return _m->compare_with(a);
17503 }
17504 [[nodiscard]]constexpr auto operator==(const char_T* a)const noexcept(equal.nothrow<char_T>){
17505 if(_in_cso())
17506 return equal(data(),size(),a,end_by_zero);
17507 else
17508 return _m->equal_with(a);
17509 }
17510 //END_BLOCK
17511 private:
17512 [[nodiscard]]char_T* unique_c_str()noexcept{ _cso_check(1);return _m->get_unique_c_str(_m); }
17513 public:
17514 [[nodiscard]]char_T arec(size_t index)noexcept{
17515 if(_in_cso())
17516 return _get_cso_data()[index];
17517 else
17518 return _m->arec(index);
17519 }
17520 void arec_set(size_t index,char_T a)noexcept{ _cso_check(1);return _m->arec_set(index,a,_m); }
17521
17523 string_t* _to;
17524 size_t _index;
17525
17526 friend class string_t;
17527 public:
17528 arec_t(string_t* to,size_t index)noexcept:_to(to),_index(index){}
17529 arec_t(special_init_t,const arec_t&ref)noexcept:_to(ref._to),_index(ref._index){}
17530 [[nodiscard]]operator char_T()const&&noexcept{ return _to->arec(_index); }
17531 arec_t&& operator=(char_T a)&&noexcept{
17532 _to->arec_set(_index,a);
17533 return move(*this);
17534 }
17535 arec_t&& operator=(const arec_t&&ch)&&noexcept{ return move(*this).operator=(move(ch).operator char_T()); }
17536 private:
17537 [[nodiscard]]char_T* get_address()noexcept{ return _to->unique_c_str()+_index; }
17538 [[nodiscard]]const char_T* get_address()const noexcept{ return (add_const(_to))->c_str()+_index; }
17539 public:
17540 [[nodiscard]]char_T* operator&()&&noexcept{ return get_address(); }
17541 [[nodiscard]]const char_T* operator&()const&&noexcept{ return get_address(); }
17542 /*
17543 [[nodiscard]]explicit operator char_T&()&&noexcept{ return *get_address(); }
17544 [[nodiscard]]explicit operator const char_T&()const&&noexcept{ return *get_address(); }
17545 */
17546 };
17547
17548 [[nodiscard]]arec_t operator[](size_t index)noexcept{ return{this,index}; }
17549 [[nodiscard]]const arec_t operator[](size_t index)const noexcept{ return{remove_const(this),index}; }
17550
17551 //front
17552 [[nodiscard]]arec_t front()noexcept{ return{this,0}; }
17553 [[nodiscard]]const arec_t front()const noexcept{ return{remove_const(this),0}; }
17554 //back
17555 [[nodiscard]]arec_t back()noexcept{ return{this,size()-1}; }
17556 [[nodiscard]]const arec_t back()const noexcept{ return{remove_const(this),size()-1}; }
17557
17558
17559 [[nodiscard]]string_t operator+(const arec_t&& ch)const noexcept{
17560 return *this+move(ch).operator char_T();
17561 }
17562 string_t& operator+=(const arec_t&& ch)&noexcept{
17563 return *this+=move(ch).operator char_T();
17564 }
17565
17566 //floating arec.
17567 private:
17568 static constexpr bool floating_arec_result_able=was_not_an_ill_form(
17569 magic_number::linear_interpolation::get_result(declvalue(size_t),
17570 magic_number::linear_interpolation::get_k(declvalue(char_T),declvalue(char_T)),
17572 );
17573 static auto floating_arec_result_type_helper()noexcept{
17574 if constexpr(floating_arec_result_able)
17575 return magic_number::linear_interpolation::get_result(size_t{},
17576 magic_number::linear_interpolation::get_k(char_T{},char_T{}),
17577 float_t{});
17578 }
17579 typedef decltype(floating_arec_result_type_helper()) floating_arec_result_type;
17580 static constexpr bool floating_arec_set_able=was_not_an_ill_form(
17581 magic_number::linear_interpolation::get_reverse_result(
17582 magic_number::linear_interpolation::get_k(declvalue(char_T),declvalue(char_T)),
17583 declvalue(float_t),declvalue(char_T))
17584 );
17585 public:
17586 static constexpr bool floating_arec_able=floating_arec_result_able||floating_arec_set_able;
17588 string_t* _to;
17589 float_t _index;
17590 size_t _index_x1;
17591 size_t _index_x2;
17592
17593 friend class string_t;
17594 public:
17595 static constexpr bool result_able=floating_arec_result_able;
17596 static constexpr bool set_able=floating_arec_set_able;
17597
17598 floating_arec_t(string_t* to,float_t index)noexcept:_to(to),_index(index){
17599 _index_x1=static_cast<size_t>(index);
17600 _index_x2=_index_x1+1;
17601 }
17602 floating_arec_t(special_init_t,const floating_arec_t&ref)noexcept:_to(ref._to),_index(ref._index){}
17603 [[nodiscard]]operator floating_arec_result_type()const&&noexcept requires result_able{
17604 char_T y1=_to->arec(_index_x1);
17605 char_T y2=_to->arec(_index_x2);
17606 auto δx=_index-_index_x1;
17607 return magic_number::linear_interpolation::get_result(y1,
17608 magic_number::linear_interpolation::get_k(y1,y2),
17609 δx);
17610 }
17611 floating_arec_t&& operator=(floating_arec_result_type a)&&noexcept requires set_able{
17612 char_T y1=_to->arec(_index_x1);
17613 char_T y2=_to->arec(_index_x2);
17614 auto k=magic_number::linear_interpolation::get_k(y1,y2);
17615 auto δx1=_index-_index_x1;
17616 auto δx2=_index-_index_x2;
17617 y1=(char_T)magic_number::linear_interpolation::get_reverse_result(k,δx1,a);
17618 y2=(char_T)magic_number::linear_interpolation::get_reverse_result(k,δx2,a);
17619 _to->arec_set(_index_x1,y1);
17620 _to->arec_set(_index_x2,y2);
17621 return move(*this);
17622 }
17623 };
17624 [[nodiscard]]floating_arec_t operator[](float_t index)noexcept requires(floating_arec_able){ return{this,index}; }
17625 [[nodiscard]]const floating_arec_t operator[](float_t index)const noexcept requires(floating_arec_able){ return{remove_const(this),index}; }
17626
17627 //泛型arec.
17628 template<typename T> requires ::std::is_arithmetic_v<T>
17629 [[nodiscard]]auto operator[](T index)noexcept{
17630 if constexpr(::std::is_floating_point_v<T>)
17631 return operator[](static_cast<float_t>(index));
17632 else
17633 return operator[](static_cast<size_t>(index));
17634 }
17635 template<typename T> requires ::std::is_arithmetic_v<T>
17636 [[nodiscard]]const auto operator[](T index)const noexcept{
17637 if constexpr(::std::is_floating_point_v<T>)
17638 return operator[](static_cast<float_t>(index));
17639 else
17640 return operator[](static_cast<size_t>(index));
17641 }
17642
17643 [[nodiscard]]string_t substr(size_t begin,size_t size=npos)const noexcept{
17644 size=min(size,this->size()-begin);
17645 if(size){
17646 _cso_check();
17647 return _m->get_substr_data(begin,size);
17648 }
17649 else
17650 return {};
17651 }
17652 [[nodiscard]]const char_T* data()const noexcept{ if(_in_cso())return _get_cso_data();else return _m->get_data(_m); }
17653 [[nodiscard]]char_T* writeable_data()noexcept{ return unique_c_str(); }
17654 [[nodiscard]]const char_T* c_str()const noexcept{ if(_in_cso())return _get_cso_data();else return _m->get_const_c_str(_m); }
17655 [[nodiscard]]char_T* writeable_c_str()noexcept{ return unique_c_str(); }
17656 [[nodiscard]]size_t size()const noexcept{ if(_in_cso())return _get_cso_size();else return _m->get_size(); }
17657 [[nodiscard]]explicit operator bool()const noexcept{ return size(); }
17658 [[nodiscard]]bool empty()const noexcept{ return !size(); }
17659 [[nodiscard]]size_t length()const noexcept{ return size(); }
17660 void resize(size_t nsize,char_T ch)noexcept{
17661 const auto size=this->size();
17662 if(size > nsize)
17663 *this=substr(0,nsize);
17664 elseif(size == nsize)
17665 return;
17666 elseif(size){
17667 _cso_check();
17668 _m=get<end_apply_string_data_t<char_T>>(_m,nsize-size,ch);
17669 }
17670 else
17671 *this=string_t{nsize,ch};
17672 }
17673 void resize(size_t nsize)noexcept{
17674 const auto size=this->size();
17675 if(size > nsize)
17676 *this=substr(0,nsize);
17677 elseif(size == nsize)
17678 return;
17679 elseif(size){
17680 _cso_check();
17681 _m=get<end_apply_string_data_t<char_T>>(_m,nsize-size);
17682 }
17683 else
17684 *this=string_t{nsize};
17685 }
17686 void clear()noexcept{ re_construct(this); }
17687 private:
17688 struct iterator_base_t{
17689 string_t* _to;
17690 ptrdiff_t _index; //rend: -1,使用size_t也不是不可以(标准允许无符号整数溢出),但是operator<=>会出问题
17691
17692 [[nodiscard]]constexpr iterator_base_t get_before()const noexcept{ return{_to,_index-1}; }
17693 [[nodiscard]]constexpr iterator_base_t get_next()const noexcept{ return{_to,_index+1}; }
17694 [[nodiscard]]arec_t get_value()noexcept{ return (*_to)[_index]; }
17695 [[nodiscard]]const arec_t get_value()const noexcept{ return (*add_const(_to))[_index]; }
17696 [[nodiscard]]char_T* get_handle()noexcept{ return &get_value(); }
17697 [[nodiscard]]const char_T* get_handle()const noexcept{ return &get_value(); }
17698 [[nodiscard]]constexpr bool operator==(const iterator_base_t& a)const noexcept{ return _to==a._to && _index==a._index; }
17699 [[nodiscard]]constexpr auto operator<=>(const iterator_base_t& a)const noexcept{ return _to==a._to ? _index<=>a._index : partial_ordering::unordered; }
17700 };
17701 [[nodiscard]]iterator_base_t get_iterator_data_at(ptrdiff_t index)const noexcept{ return iterator_base_t{(string_t*)this,index}; }
17702 public:
17703 typedef iterator_t<char_T,iterator_base_t> iterator;
17704 typedef const_iterator_t<char_T,const iterator_base_t> const_iterator;
17705
17706 [[nodiscard]]iterator get_iterator_at(ptrdiff_t index)noexcept{ return get_iterator_data_at(index); }
17707 [[nodiscard]]const_iterator get_iterator_at(ptrdiff_t index)const noexcept{ return get_iterator_data_at(index); }
17708 [[nodiscard]]iterator begin()noexcept{ return get_iterator_at(0); }
17709 [[nodiscard]]const_iterator begin()const noexcept{ return get_iterator_at(0); }
17710 [[nodiscard]]const_iterator cbegin()const noexcept{ return begin(); }
17711 [[nodiscard]]iterator end()noexcept{ return get_iterator_at(size()); }
17712 [[nodiscard]]const_iterator end()const noexcept{ return get_iterator_at(size()); }
17713 [[nodiscard]]const_iterator cend()const noexcept{ return end(); }
17714
17715 typedef reverse_iterator_t<char_T,iterator_base_t> reverse_iterator;
17716 typedef reverse_const_iterator_t<char_T,const iterator_base_t> reverse_const_iterator;
17717
17718 [[nodiscard]]reverse_iterator get_reverse_iterator_at(ptrdiff_t index)noexcept{ return get_iterator_data_at(index); }
17719 [[nodiscard]]reverse_const_iterator get_reverse_iterator_at(ptrdiff_t index)const noexcept{ return get_iterator_data_at(index); }
17720 [[nodiscard]]reverse_iterator rbegin()noexcept{ return get_reverse_iterator_at(size()-1); }
17721 [[nodiscard]]reverse_const_iterator rbegin()const noexcept{ return get_reverse_iterator_at(size()-1); }
17722 [[nodiscard]]reverse_const_iterator rcbegin()const noexcept{ return rbegin(); }
17723 [[nodiscard]]reverse_iterator rend()noexcept{ return get_reverse_iterator_at(-1); }
17724 [[nodiscard]]reverse_const_iterator rend()const noexcept{ return get_reverse_iterator_at(-1); }
17725 [[nodiscard]]reverse_const_iterator rcend()const noexcept{ return rend(); }
17726
17727 //
17728
17729 void push_back(const string_t& str)&noexcept{
17730 full_copy_cso_check(*this);
17731 full_copy_cso_check(str);
17732 if(_in_cso()&&!str._in_cso())
17733 _cso_fin(str._m->apply_str_to_begin(to_string_view_t()));
17734 elseif(str._in_cso()){
17735 push_back(str.to_string_view_t());
17736 }
17737 else{
17738 _cso_check();
17739 _m=_m->apply_str_to_end(str._m);
17740 }
17741 }
17742 void push_back(string_view_t str)&noexcept{ _cso_check();_m=_m->apply_str_to_end(str); }
17743 void push_back(char_T ch)&noexcept{ push_back(string_view_t{&ch,1}); }
17744 void push_back(const arec_t&& ch)&noexcept{ push_back(move(ch).operator char_T()); }
17745 void push_back(const char_T* str)&noexcept{ push_back(string_view_t(str)); }
17746
17747 void push_front(const string_t& str)&noexcept{
17748 full_copy_cso_check(*this);
17749 full_copy_cso_check(str);
17750 if(_in_cso()&&!str._in_cso())
17751 _cso_fin(str._m->apply_str_to_end(to_string_view_t()));
17752 elseif(str._in_cso()){
17753 push_front(str.to_string_view_t());
17754 }
17755 else{
17756 _cso_check();
17757 _m=_m->apply_str_to_begin(str._m);
17758 }
17759 }
17760 void push_front(string_view_t str)&noexcept{ _cso_check();_m=_m->apply_str_to_begin(str); }
17761 void push_front(char_T ch)&noexcept{ push_front(string_view_t{&ch,1}); }
17762 void push_front(const arec_t&& ch)&noexcept{ push_front(move(ch).operator char_T()); }
17763 void push_front(const char_T* str)&noexcept{ push_front(string_view_t(str)); }
17764
17765 string_t pop_back(size_t size)noexcept{ _cso_check();return _m->do_pop_back(size,_m); }
17766 string_t pop_front(size_t size)noexcept{ _cso_check();return _m->do_pop_front(size,_m); }
17767 char_T pop_back()noexcept{ return pop_back(1)[0]; }
17768 char_T pop_front()noexcept{ return pop_front(1)[0]; }
17769
17770 //
17771
17772 [[nodiscard]]operator string_view_t()const&noexcept{ return string_view_t{data(),size()}; }
17773 [[nodiscard]]auto to_string_view_t()const&noexcept{ return operator string_view_t(); }
17774 [[nodiscard]]auto view()&noexcept{ return array_like_view_t<char_T>{writeable_data(),size()}; }
17775 [[nodiscard]]auto view()const&noexcept{ return array_like_view_t<const char_T>{data(),size()}; }
17776 [[nodiscard]]explicit operator hash_t()const noexcept{ return _in_cso()?_get_cso_hash():_m->get_hash(_m); }
17777
17778 //
17779 static constexpr bool find_nothrow=equal.nothrow<char_T>;
17780 [[nodiscard]]size_t find(const char_T ch,size_t begin=0)const noexcept(find_nothrow){
17781 return in_range_size_t(ch, to_string_view_t().substr(begin));
17782 }
17783 [[nodiscard]]size_t reverse_find(const char_T ch)const noexcept(find_nothrow){
17784 return in_range_but_reverse_size_t(ch, to_string_view_t());
17785 }
17786 [[nodiscard]]size_t find(string_view_t str,size_t begin=0)const noexcept(find_nothrow){
17787 return in_range_size_t(str, to_string_view_t().substr(begin));
17788 }
17789 [[nodiscard]]size_t reverse_find(string_view_t str)const noexcept(find_nothrow){
17790 return in_range_but_reverse_size_t(str, to_string_view_t());
17791 }
17792 [[nodiscard]]size_t find(constexpr_str_t&str,size_t begin=0)const noexcept(find_nothrow){
17793 return in_range_size_t(str, to_string_view_t().substr(begin));
17794 }
17795 [[nodiscard]]size_t reverse_find(constexpr_str_t&str)const noexcept(find_nothrow){
17796 return in_range_but_reverse_size_t(str, to_string_view_t());
17797 }
17798 [[nodiscard]]size_t find(const string_t&str,size_t begin=0)const noexcept(find_nothrow){
17799 if(str._in_cso()){
17800 if(str._in_str_cso())
17801 return find(str._get_cso_constexpr_str(),begin);
17802 elseif(str._in_cso())
17803 return find(str._cso_info._ch,begin);
17804 }
17805 auto result = str._m->get_match_pattern_from_self(str._m).match(to_string_view_t().substr(begin));
17806 if(result)
17807 return result - data();
17808 else
17809 return npos;
17810 }
17811 [[nodiscard]]size_t reverse_find(const string_t&str)const noexcept(find_nothrow){
17812 if(str._in_cso()){
17813 if(str._in_str_cso())
17814 return reverse_find(str._get_cso_constexpr_str());
17815 elseif(str._in_cso())
17816 return reverse_find(str._cso_info._ch);
17817 }
17818 auto result = str._m->get_reverse_match_pattern_from_self(str._m).match(to_string_view_t());
17819 if(result)
17820 return result - data();
17821 else
17822 return npos;
17823 }
17824 //
17825 [[nodiscard]]size_t find_first_of(string_view_t str)const noexcept(find_nothrow){
17826 return range_n::find_first_of_size_t(str,to_string_view_t());
17827 }
17828 [[nodiscard]]size_t find_first_of(constexpr_str_t&str)const noexcept(find_nothrow){
17829 return range_n::find_first_of_size_t(str,to_string_view_t());
17830 }
17831 [[nodiscard]]size_t find_first_of(const string_t&str)const noexcept(find_nothrow){
17832 if(str._in_cso()){
17833 if(str._in_str_cso())
17834 return find_first_of(str._get_cso_constexpr_str());
17835 elseif(str._in_cso())
17836 return find(str._cso_info._ch);
17837 }
17838 return find_first_of(str.to_string_view_t());
17839 }
17840 [[nodiscard]]size_t find_first_of(const char_T*str)const noexcept(find_nothrow){
17841 return find_first_of(string_view_t(str));
17842 }
17843 [[nodiscard]]size_t find_first_of(char_T ch)const noexcept(find_nothrow){
17844 return find(ch);
17845 }
17846 [[nodiscard]]size_t find_first_of(const arec_t&&ch)const noexcept(find_nothrow){
17847 return find(move(ch).operator char_T());
17848 }
17849 [[nodiscard]]size_t find_first_not_of(string_view_t str)const noexcept(find_nothrow){
17850 return range_n::find_first_not_of_size_t(str,to_string_view_t());
17851 }
17852 [[nodiscard]]size_t find_first_not_of(constexpr_str_t&str)const noexcept(find_nothrow){
17853 return range_n::find_first_not_of_size_t(str,to_string_view_t());
17854 }
17855 [[nodiscard]]size_t find_first_not_of(const string_t&str)const noexcept(find_nothrow){
17856 if(str._in_cso()){
17857 if(str._in_str_cso())
17858 return find_first_not_of(str._get_cso_constexpr_str());
17859 elseif(str._in_cso())
17860 return find_first_not_of(str.to_string_view_t());
17861 }
17862 return find_first_not_of(str.to_string_view_t());
17863 }
17864 [[nodiscard]]size_t find_first_not_of(const char_T*str)const noexcept(find_nothrow){
17865 return find_first_not_of(string_view_t(str));
17866 }
17867 [[nodiscard]]size_t find_first_not_of(char_T ch)const noexcept(find_nothrow){
17868 return find_first_not_of(string_view_t(ch));
17869 }
17870 [[nodiscard]]size_t find_first_not_of(const arec_t&&ch)const noexcept(find_nothrow){
17871 return find_first_not_of(string_view_t(move(ch).operator char_T()));
17872 }
17873 [[nodiscard]]size_t find_last_of(string_view_t str)const noexcept(find_nothrow){
17874 return range_n::find_last_of_size_t(str,to_string_view_t());
17875 }
17876 [[nodiscard]]size_t find_last_of(constexpr_str_t&str)const noexcept(find_nothrow){
17877 return range_n::find_last_of_size_t(str,to_string_view_t());
17878 }
17879 [[nodiscard]]size_t find_last_of(const string_t&str)const noexcept(find_nothrow){
17880 if(str._in_cso()){
17881 if(str._in_str_cso())
17882 return find_last_of(str._get_cso_constexpr_str());
17883 elseif(str._in_cso())
17884 return reverse_find(str._cso_info._ch);
17885 }
17886 return find_last_of(str.to_string_view_t());
17887 }
17888 [[nodiscard]]size_t find_last_of(const char_T*str)const noexcept(find_nothrow){
17889 return find_last_of(string_view_t(str));
17890 }
17891 [[nodiscard]]size_t find_last_of(char_T ch)const noexcept(find_nothrow){
17892 return reverse_find(ch);
17893 }
17894 [[nodiscard]]size_t find_last_of(const arec_t&&ch)const noexcept(find_nothrow){
17895 return reverse_find(move(ch).operator char_T());
17896 }
17897 [[nodiscard]]size_t find_last_not_of(string_view_t str)const noexcept(find_nothrow){
17898 return range_n::find_last_not_of_size_t(str,to_string_view_t());
17899 }
17900 [[nodiscard]]size_t find_last_not_of(constexpr_str_t&str)const noexcept(find_nothrow){
17901 return range_n::find_last_not_of_size_t(str,to_string_view_t());
17902 }
17903 [[nodiscard]]size_t find_last_not_of(const string_t&str)const noexcept(find_nothrow){
17904 if(str._in_cso()){
17905 if(str._in_str_cso())
17906 return find_last_not_of(str._get_cso_constexpr_str());
17907 elseif(str._in_cso())
17908 return find_last_not_of(str.to_string_view_t());
17909 }
17910 return find_last_not_of(str.to_string_view_t());
17911 }
17912 [[nodiscard]]size_t find_last_not_of(const char_T*str)const noexcept(find_nothrow){
17913 return find_last_not_of(string_view_t(str));
17914 }
17915 [[nodiscard]]size_t find_last_not_of(char_T ch)const noexcept(find_nothrow){
17916 return find_last_not_of(string_view_t{&ch,1});
17917 }
17918 [[nodiscard]]size_t find_last_not_of(const arec_t&&ch)const noexcept(find_nothrow){
17919 return find_last_not_of(move(ch).operator char_T());
17920 }
17921
17922 //
17923
17924 [[nodiscard]]string_t arec(size_t index,char_T delimiter)const{
17925 auto pos=find(delimiter);
17926 auto end=find(delimiter,pos);
17927 while(index--){
17928 pos=end;
17929 end=find(delimiter,pos);
17930 }
17931 return substr(pos,end-pos);
17932 }
17933 [[nodiscard]]string_t arec(size_t index,string_view_t delimiter_str)const{
17934 auto pos=find(delimiter_str);
17935 auto end=find(delimiter_str,pos);
17936 while(index--){
17937 pos=end;
17938 end=find(delimiter_str,pos);
17939 }
17940 return substr(pos,end-pos);
17941 }
17942 [[nodiscard]]string_t arec(size_t index,const string_t&delimiter_str)const{
17943 auto pos=find(delimiter_str);
17944 auto end=find(delimiter_str,pos);
17945 while(index--){
17946 pos=end;
17947 end=find(delimiter_str,pos);
17948 }
17949 return substr(pos,end-pos);
17950 }
17951 [[nodiscard]]string_t arec(size_t index,constexpr_str_t&delimiter_str)const{
17952 auto pos=find(delimiter_str);
17953 auto end=find(delimiter_str,pos);
17954 while(index--){
17955 pos=end;
17956 end=find(delimiter_str,pos);
17957 }
17958 return substr(pos,end-pos);
17959 }
17960
17961 //
17962
17963 void erase(size_t pos,size_t size=1)&noexcept{
17964 _cso_check();_m=_m->do_erase(pos,size);
17965 }
17966 void insert(size_t pos,const string_t& str)&noexcept{
17967 _cso_check();
17968 full_copy_cso_check(str);
17969 if(str._in_cso())
17970 _m=_m->do_insert(pos,str.to_string_view_t());
17971 else
17972 _m=_m->do_insert(pos,str);
17973 }
17974 void insert(size_t pos,string_view_t str)&noexcept{
17975 _cso_check();_m=_m->do_insert(pos,str);
17976 }
17977 void insert(size_t pos,const char_T* str)&noexcept{
17978 insert(pos,string_view_t(str));
17979 }
17980 void insert(size_t pos,char_T ch)&noexcept{
17981 insert(pos,string_view_t{&ch,1});
17982 }
17983
17984 //
17985
17986 //contains
17987 constexpr bool contains(string_view_t str)const noexcept{
17988 return find(str) != npos;
17989 }
17990 constexpr bool contains(constexpr_str_t&str)const noexcept{
17991 return find(str) != npos;
17992 }
17993 constexpr bool contains(const string_t&str)const noexcept{
17994 return find(str) != npos;
17995 }
17996 constexpr bool contains(char_T ch)const noexcept{
17997 return find(ch) != npos;
17998 }
17999 constexpr bool contains(const char_T*str)const noexcept{
18000 return find(str) != npos;
18001 }
18002
18003 //starts_with
18004 constexpr bool starts_with(string_view_t str)const noexcept{
18005 if(size()<str.size())
18006 return false;
18007 return substr(0,str.size()) == str;
18008 }
18009 constexpr bool starts_with(constexpr_str_t&str)const noexcept{
18010 if(size()<str.size())
18011 return false;
18012 return substr(0,str.size()) == str;
18013 }
18014 constexpr bool starts_with(const string_t&str)const noexcept{
18015 if(size()<str.size())
18016 return false;
18017 if(str._in_chr_cso())
18018 return starts_with(str._cso_info._ch);
18019 else
18020 return substr(0,str.size()) == str;
18021 }
18022 constexpr bool starts_with(char_T ch)const noexcept{
18023 if(size()<1)
18024 return false;
18025 return operator[](0) == ch;
18026 }
18027 constexpr bool starts_with(const char_T*str)const noexcept{
18028 return starts_with(string_view_t{str});
18029 }
18030
18031 //ends_with
18032 constexpr bool ends_with(string_view_t str)const noexcept{
18033 if(size()<str.size())
18034 return false;
18035 return substr(size()-str.size()) == str;
18036 }
18037 constexpr bool ends_with(constexpr_str_t&str)const noexcept{
18038 if(size()<str.size())
18039 return false;
18040 return substr(size()-str.size()) == str;
18041 }
18042 constexpr bool ends_with(const string_t&str)const noexcept{
18043 if(size()<str.size())
18044 return false;
18045 if(str._in_chr_cso())
18046 return ends_with(str._cso_info._ch);
18047 else
18048 return substr(size()-str.size()) == str;
18049 }
18050 constexpr bool ends_with(char_T ch)const noexcept{
18051 if(size()<1)
18052 return false;
18053 return operator[](size()-1) == ch;
18054 }
18055 constexpr bool ends_with(const char_T*str)const noexcept{
18056 return ends_with(string_view_t{str});
18057 }
18058
18059 this_t& append(size_t size,char_T ch)noexcept{
18060 return *this+=string_t{size,ch};
18061 }
18062 /*
18063 compare
18064 replace
18065 */
18066 #undef _m
18067 };
18068
18069 //推导指引
18070 template<class char_T>
18071 string_t(const char_T*) -> string_t<char_T>;
18072 template<class char_T>
18074
18075 //string的swap特化
18076 template<typename T>
18077 inline void swap(string_t<T>& a,string_t<T>& b)noexcept{ a.swap_with(b); }
18078
18079 //std ostream支持
18080 template<typename some_fucking_std_ostream, typename T>
18081 decltype(auto) operator<<(some_fucking_std_ostream& stream, const string_t<T>& str){
18082 typedef some_fucking_std_ostream stream_t;
18083 typedef stream_t::traits_type traits_t;
18084 typename stream_t::iostate state = stream_t::goodbit;
18085
18086 suppress_msvc_warning(26494);//未初始化警告diss
18087 size_t pad;
18088 size_t size = str.size();
18089 if(stream.width() <= 0 || static_cast<size_t>(stream.width()) <= size)
18090 pad = 0;
18091 else
18092 pad = static_cast<size_t>(stream.width()) - size;
18093
18094 const typename stream_t::sentry isok(stream);
18095
18096 if(!isok)
18097 state |= stream_t::badbit;
18098 else {
18099 try {
18100 if((stream.flags() & stream_t::adjustfield) != stream_t::left){
18101 for(; 0 < pad; --pad){ // pad on left
18102 if(traits_t::eq_int_type(traits_t::eof(), stream.rdbuf()->sputc(stream.fill()))){
18103 state |= stream_t::badbit; // insertion failed, quit
18104 break;
18105 }
18106 }
18107 }
18108
18109 if(state == stream_t::goodbit && stream.rdbuf()->sputn(str.c_str(), static_cast<::std::streamsize>(size)) != static_cast<::std::streamsize>(size))
18110 state |= stream_t::badbit;
18111 else {
18112 for(; 0 < pad; --pad){ // pad on right
18113 if(traits_t::eq_int_type(traits_t::eof(), stream.rdbuf()->sputc(stream.fill()))){
18114 state |= stream_t::badbit; // insertion failed, quit
18115 break;
18116 }
18117 }
18118 }
18119
18120 stream.width(0);
18121 }
18122 catch(...){
18123 stream.setstate(stream_t::badbit, true);
18124 return stream;
18125 }
18126 }
18127 stream.setstate(state);
18128 return stream;
18129 }
18130
18131 //array like支持
18132 template<class T>
18133 [[nodiscard]]inline auto size_of_array_like(const string_t<remove_cv<T>>& a)noexcept{ return a.size(); }
18134 template<class T>
18135 [[nodiscard]]inline auto begin_of_array_like(string_t<remove_cv<T>>& a)noexcept{ return a.c_str(); }
18136 template<class T>
18137 [[nodiscard]]inline auto begin_of_array_like(const string_t<remove_cv<T>>& a)noexcept{ return a.c_str(); }
18138
18139 //typedef
18140 typedef string_t<char_t>string;
18141 }
18142 using string_n::string_t;
18143 using string_n::string;
18144
18145 //file_end
18146
18147 #line 15 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/_body.hpp"
18148
18149 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
18150 //_undefs.hpp
18151 /*
18152 未完成的elc解释器basic文件
18153 由steve02081504与Alex0125设计、编写
18154 转载时请在不对此文件做任何修改的同时注明出处
18155 项目地址:https://github.com/steve02081504/ELC
18156 */
18157 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_undefs.hpp"
18158 //_undefs.hpp
18159 /*
18160 未完成的elc解释器_share文件
18161 由steve02081504与Alex0125设计、编写
18162 转载时请在不对此文件做任何修改的同时注明出处
18163 项目地址:https://github.com/steve02081504/ELC
18164 */
18165
18166 //defs at "_defs.hpp"
18167
18168 #if defined(_MSC_VER)
18169 #pragma warning(pop)
18170 #endif
18171 #undef suppress_msvc_warning
18172 #undef disable_msvc_warning
18173 #undef push_msvc_warning
18174 #undef pop_msvc_warning
18175 #undef push_and_disable_msvc_warning
18176
18177 //for basic_environment.hpp
18178 #undef BIT_POSSIBILITY
18179 //
18180 #if defined(ELC_VOID_NAME)
18181 #define void the_void
18182 #endif
18183
18184 // #undef often_noexcept
18185 #undef noexcept_as
18186 #undef noexcept_as_auto
18187 #undef constexpr_as
18188 #undef constexpr_as_auto
18189
18190 #undef using_method_from_base_t
18191 #undef using_method_from_value
18192
18193 #undef floop
18194 #undef enable_adl
18195
18196 #undef re_declvalue
18197 #undef re_decltype
18198
18199 #undef declvalue
18200
18201 #undef template_error
18202 #undef template_warning
18203
18204 #undef type_info_of
18205 #undef type_name_of
18206
18207 #undef is_common_attribute
18208 #undef is_special_attribute
18209
18210 #undef has_attribute
18211 #undef not_has_attribute
18212
18213 #undef float_size_of
18214 #undef bitnum_of
18215
18216 #undef def_common_attribute_with_nothing
18217 #undef def_special_attribute_with_nothing
18218
18219 #undef common_attribute_t
18220 #undef special_attribute_t
18221
18222 #undef enable_if
18223 #undef enabled_by_default
18224 #undef disabled_by_default
18225 #undef enable_if_not_ill_form
18226 #undef enable_flag
18227
18228 #undef was_an_ill_form
18229 #undef was_an_ill_form_with_parameter
18230 #undef was_not_an_ill_form
18231 #undef was_not_an_ill_form_and_noexcept
18232 #undef was_not_an_ill_form_with_parameter
18233
18234 #undef recursive_lambda
18235 #undef get_recursive_lambda_caller
18236 #undef lambda
18237 #undef lambda_with_catch
18238 #undef self_recursion
18239 #undef lambda_RLSRRS
18240
18241 #undef MAGIC
18242
18243 #undef nothing
18244
18245 #undef elseif
18246 #undef _big_than_
18247 #undef _small_than_
18248
18249 #if defined(_MSC_VER)
18250 #undef not
18251 #undef and
18252 #undef or
18253 #endif
18254
18255 #undef INTER_NAMESPACE
18256 #undef BREAK_NAMESPACE
18257
18258 #undef szie
18259 #undef form
18260
18261 #undef template_name
18262 #undef type_name
18263
18264 #undef not_in_debug
18265
18266 #undef es
18267 #undef ec
18268
18269 #undef ELC_TEST_EVENTNAME
18270
18271 #undef override_instance_struct
18272
18273 #undef distinctive
18274
18275 #undef force_inline
18276
18277 #undef with_no_vtable
18278
18279 #undef in_consteval
18280
18281 #undef no_vtable_struct
18282 #undef no_vtable_class
18283
18284 //file_end
18285
18286 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
18287
18288 //file_end
18289
18290 #line 17 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/_body.hpp"
18291 }
18292 //strings
18293 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/str_code_convert.hpp"
18294 //str_code_convert.hpp
18295 /*
18296 未完成的elc解释器_share文件
18297 由steve02081504与Alex0125设计、编写
18298 转载时请在不对此文件做任何修改的同时注明出处
18299 项目地址:https://github.com/steve02081504/ELC
18300 */
18301 /*
18302 APIs说明
18303 elc依赖的基础函数.
18304 调整这些,实现快速移植,快速优化与行为自定义.
18305 */
18306 #if !defined(ELC_APIS_str_code_convert)
18307 #define ELC_APIS_str_code_convert
18308 #include <cuchar>
18309 #include <clocale>
18310 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/default_data_type.hpp"
18311 //default_data_type.hpp
18312 /*
18313 未完成的elc解释器_share文件
18314 由steve02081504与Alex0125设计、编写
18315 转载时请在不对此文件做任何修改的同时注明出处
18316 项目地址:https://github.com/steve02081504/ELC
18317 */
18318 namespace elc{
18319 /*ELC内部string统一采用char_t宽字符,使用setlocale(LC_ALL,"en_US.utf8")下的UTF编码。*/
18320 typedef char32_t char_t;
18321 /*ELC内部钦定int_t类型*/
18322 typedef int64_t int_t;
18323 /*ELC内部钦定uint_t类型*/
18324 typedef uint64_t uint_t;
18325 /*ELC内部钦定float_t类型*/
18326 typedef double float_t;
18327 /*ELC内部钦定float_size_t类型,用以描述内存大小的浮点状况*/
18328 typedef long double float_size_t;
18329 }
18330
18331 //file_end
18332
18333 #line 17 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/str_code_convert.hpp"
18334 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/string"
18335 //string
18336 //at namespace ::
18337 /*
18338 未完成的elc解释器include文件
18339 由steve02081504与Alex0125设计、编写
18340 转载时请在不对此文件做任何修改的同时注明出处
18341 项目地址:https://github.com/steve02081504/ELC
18342 */
18343 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/string"
18344
18345 //file_end
18346
18347 #line 18 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/str_code_convert.hpp"
18349 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
18350 //_defs.hpp
18351 /*
18352 未完成的elc解释器_share文件
18353 由steve02081504与Alex0125设计、编写
18354 转载时请在不对此文件做任何修改的同时注明出处
18355 项目地址:https://github.com/steve02081504/ELC
18356 */
18357
18358 //undefs at "_undefs.hpp"
18359
18360 //set ELC_WARNING_LEVEL default to 4(max)
18361 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
18362
18363 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/basic_environment.hpp"
18364 //basic_environment.hpp
18365 /*
18366 未完成的elc解释器_share文件
18367 由steve02081504与Alex0125设计、编写
18368 转载时请在不对此文件做任何修改的同时注明出处
18369 项目地址:https://github.com/steve02081504/ELC
18370 */
18371
18374 #define BIT_POSSIBILITY 2
18375
18376 //file_end
18377
18378 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
18379
18380 #if defined(_MSC_VER)
18381 #pragma warning(push,ELC_WARNING_LEVEL)
18382 #pragma warning(disable:4099)//class与struct混用警告diss
18383 #pragma warning(disable:26812)//enum class安利diss.
18384 #pragma warning(disable:4584)//重复子类警告diss
18385 #pragma warning(disable:4250)//域控制继承警告diss
18386 #pragma warning(disable:26432)//不完全默认方法警告diss
18387 #pragma warning(disable:26435)//virtual override方法警告diss
18388 #pragma warning(disable:26481)//容器安利diss
18389 #pragma warning(disable:26446)//gsl::at安利diss
18390 #pragma warning(disable:26434)//方法覆盖警告diss
18391 #pragma warning(disable:26429)//gsl::not_null安利diss
18392 #pragma warning(disable:26471)//对void*进行static_cast安利diss
18393 #pragma warning(disable:26474)//隐式指针转换显式cast警告diss
18394 #pragma warning(disable:26473)//相同指针显式cast警告diss
18395 #pragma warning(disable:26456)//隐藏非虚运算符警告diss
18396 #pragma warning(disable:26485)//数组作指针警告diss
18397 #pragma warning(disable:26490)//reinterpret_cast警告diss
18398 #pragma warning(disable:26472)//static_cast窄幅转换警告diss
18399 #pragma warning(disable:26482)//非常数数组索引警告diss
18400 #pragma warning(disable:26493)//c_cast转换警告diss:虽然有用但是太烦了,爬
18401 #endif
18402 #if defined(_MSC_VER)
18403 #define suppress_msvc_warning(...) __pragma(warning(suppress:__VA_ARGS__))
18404 #define disable_msvc_warning(...) __pragma(warning(disable:__VA_ARGS__))
18405 #define push_msvc_warning() __pragma(warning(push))
18406 #define pop_msvc_warning() __pragma(warning(pop))
18407 #define push_and_disable_msvc_warning(...) push_msvc_warning() disable_msvc_warning(__VA_ARGS__)
18408 #else
18409 #define suppress_msvc_warning(...)
18410 #define disable_msvc_warning(...)
18411 #define push_msvc_warning()
18412 #define pop_msvc_warning()
18413 #define push_and_disable_msvc_warning(...)
18414 #endif
18415 //
18416 #if defined(ELC_VOID_NAME)
18417 #undef void
18418 #endif
18419
18420 // #define often_noexcept
18421 #define noexcept_as(...) noexcept(noexcept((__VA_ARGS__)))//dnmd C艹标准就是没有noexcept_as_auto
18422 #define noexcept_as_auto MAGIC//哦现在有了
18423 #define constexpr_as(...) MAGIC constexpr//( •̀ ω •́ )✌
18424 #define constexpr_as_auto MAGIC MAGIC constexpr//✌( •̀ ω •́ )✌
18425
18426 #define using_method_from_base_t(name,...) \
18427 template<class...Args> requires was_not_an_ill_form(declvalue(base_t).name(declvalue(Args)...))\
18428 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(base_t::name(declvalue(Args)...))\
18429 {\
18430 return base_t::name(forward<Args>(rest)...);\
18431 }\
18432
18433 #define using_method_from_value(name,value_name,...) \
18434 template<class...Args> requires was_not_an_ill_form(re_declvalue(value_name).name(declvalue(Args)...))\
18435 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(re_declvalue(value_name).name(declvalue(Args)...))\
18436 {\
18437 return value_name.name(forward<Args>(rest)...);\
18438 }\
18439
18440 #define floop while(__builtin_is_my_dick_still_there())
18441 #define enable_adl(name) void name()noexcept=delete
18442
18443 #define re_declvalue(...) (declvalue(decltype(__VA_ARGS__)))
18444 #define re_decltype(...) (decltype(declvalue(__VA_ARGS__)))
18445
18446 #define declvalue(...) (::std::declval<__VA_ARGS__>())
18447
18449 #define template_error(reason) static_assert(template_error_helper<T>,reason)
18451 #define template_warning(reason) template_warning_helper<T>(reason)
18452
18453 //for type_info
18454 #define type_info_of(...) base_type_info_t(typeid(__VA_ARGS__))
18455 #define type_name_of(...) (type_info_of(__VA_ARGS__).name())
18456
18457 #define is_common_attribute(name) public attribute<T,name<T>>
18458 #define is_special_attribute(name) public attribute<T,name>
18459
18460 #define has_attribute(...) template_name has_attribute_helper<__VA_ARGS__>()
18461 #define not_has_attribute(...) template_name not_has_has_attribute_helper<__VA_ARGS__>()
18462
18463 //for float_size_t
18464 #define float_size_of(...) (float_size_t{sizeof(__VA_ARGS__)})
18465 //bitnum_of
18466 #define bitnum_of(...) (bitnumof<__VA_ARGS__>)
18467
18468 //for attribute
18469 #define def_common_attribute_with_nothing(name) \
18470 template<typename T>\
18471 class name{}\
18472
18473 #define def_special_attribute_with_nothing(name) \
18474 class name{}\
18475
18476 #define common_attribute_t template<class>class
18477 #define special_attribute_t class
18478
18487 #define enable_if(...) class enable_state= ::std::enable_if_t<__VA_ARGS__>
18489 #define enabled_by_default class enable_state=void
18491 #define disabled_by_default class enable_state= ::std::enable_if_t<false>
18493 #define enable_if_not_ill_form(...) class enable_state= ::std::void_t<decltype(__VA_ARGS__)>
18495 #define enable_flag class enable_state
18496
18497 #define was_an_ill_form(...) (!was_not_an_ill_form(__VA_ARGS__))
18498 #define was_an_ill_form_with_parameter(...) (!was_not_an_ill_form_with_parameter(__VA_ARGS__))
18499 #define was_not_an_ill_form(...) (bool(requires{__VA_ARGS__;}))
18500 #define was_not_an_ill_form_and_noexcept(...) (bool(requires{__VA_ARGS__;{__VA_ARGS__}noexcept;}))
18501 #define was_not_an_ill_form_with_parameter(...) (bool(requires __VA_ARGS__ ))
18502
18504 #define recursive_lambda(...) lambda(auto&&lambda_RLSRRS,__VA_ARGS__)
18506 #define get_recursive_lambda_caller(name) \
18507 lambda_with_catch(&)(auto&&...Args){\
18508 return name(name,Args...);\
18509 }
18511 #define lambda []
18513 #define lambda_with_catch(...) [__VA_ARGS__]
18515 #define self_recursion(...) lambda_RLSRRS(lambda_RLSRRS,__VA_ARGS__)
18516 //recursive_lambda_self_referential_reserved_symbolname
18517 #define lambda_RLSRRS _my_jb_super_sb_name_
18518
18519 #define MAGIC//ahh,ko no tenno da!
18520
18522 #define nothing
18523
18525 #define elseif else if
18527 #define _big_than_ >
18529 #define _small_than_ <
18530
18531 #if defined(_MSC_VER)
18532 #define not !
18533 #define and &&
18534 #define or ||
18535 #endif
18536
18538 #define INTER_NAMESPACE(NAMESPACENAME) namespace NAMESPACENAME{
18540 #define BREAK_NAMESPACE }
18541
18543 #define template_name template
18545 #define type_name class
18546
18547 #if defined(DEBUG) || defined(_DEBUG)
18548 #define not_in_debug 0
18549 #else
18550 #define not_in_debug 1
18551 #endif
18552
18553 #define es U""
18554 #define ec(ch) U ## ch
18555
18556 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
18557 #define ELC_TEST_EVENTNAME(name) stest_eventer _the_stest_eventer__(L""name)
18558 #else
18559 #define ELC_TEST_EVENTNAME(name)
18560 #endif
18561
18562 #define override_instance_struct \
18563 protected:\
18564 virtual void abstract_method_unget_this()noexcept_as(instance_struct<this_t>::abstract_method_unget_this())override{instance_struct<this_t>::abstract_method_unget_this();}\
18565 virtual void* _abstract_method_copy_get_this()noexcept_as(instance_struct<this_t>::_abstract_method_copy_get_this())override{return instance_struct<this_t>::_abstract_method_copy_get_this();}\
18566 virtual void* _abstract_method_get_resize_this(size_t size)noexcept_as(instance_struct<this_t>::instance_struct<this_t>::_abstract_method_get_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_resize_this(size);}\
18567 virtual void* _abstract_method_get_forward_resize_this(size_t size)noexcept_as(instance_struct<this_t>::_abstract_method_get_forward_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_forward_resize_this(size);}\
18568 virtual size_t abstract_method_get_size_of_get_for_this()noexcept override{return instance_struct<this_t>::abstract_method_get_size_of_get_for_this();}
18569
18570 #if defined(_WIN32)
18571 #define distinctive __declspec(dllexport)
18572 #else
18573 #define distinctive
18574 #endif
18575
18576 #if defined(_WIN32)
18577 #define force_inline __forceinline
18578 #elif defined(__GNUC__)
18579 #define force_inline __attribute__((always_inline)) inline
18580 #else
18581 #define force_inline inline
18582 #endif
18583
18584 #if defined(_WIN32)
18585 #define with_no_vtable __declspec(novtable)
18586 #else
18587 #define with_no_vtable
18588 #endif
18589
18590 #define in_consteval (::std::is_constant_evaluated())
18591
18592 #define no_vtable_struct struct with_no_vtable
18593 #define no_vtable_class class with_no_vtable
18594
18595 //file_end
18596
18597 #line 20 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/str_code_convert.hpp"
18598
18599 using namespace ::elc::defs;//get def
18600
18601 [[nodiscard]]inline string_t<char> to_char_str(string_view_t<char_t> a)noexcept{
18602 string_t<char>aret;
18603 ::std::mbstate_t stat{};
18604 string_t old_lc=::std::setlocale(LC_CTYPE,nullptr);
18605 if(::std::setlocale(LC_CTYPE,"en_US.utf8")==nullptr)
18606 die_with(locale::str::setlocale_error);
18607 push_and_disable_msvc_warning(26494)//未初始化警告diss
18608 char r[MB_LEN_MAX];
18609 ptrdiff_t s;
18611 for(auto c:a){
18612 s=::std::c32rtomb(r,c,&stat);
18613 if(s < 0)//-1
18614 die_with(locale::str::code_convert_error);
18615 aret+=string_view_t<char>{(char*)r,note::size((size_t)s)};
18616 }
18617 ::std::setlocale(LC_CTYPE,old_lc.c_str());
18618 return aret;
18619 }
18620 [[nodiscard]]inline string_t<char_t> to_char_t_str(string_view_t<char> a)noexcept{
18621 string_t<char_t>aret;
18622 ::std::mbstate_t stat{};
18623 string_t old_lc=::std::setlocale(LC_CTYPE,nullptr);
18624 if(::std::setlocale(LC_CTYPE,"en_US.utf8")==nullptr)
18625 die_with(locale::str::setlocale_error);
18626 push_and_disable_msvc_warning(26494);//未初始化警告diss
18627 char_t c;
18628 ptrdiff_t s;
18630 auto i=a.cbegin(),e=a.cend();
18631 while(i!=e){
18632 s=::std::mbrtoc32(&c,i,MB_LEN_MAX,&stat);
18633 if(s < 0)//-3 或 -1
18634 die_with(locale::str::code_convert_error);
18635 i+=s;
18636 aret+=c;
18637 }
18638 ::std::setlocale(LC_CTYPE,old_lc.c_str());
18639 return aret;
18640 }
18641
18642 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_undefs.hpp"
18643 //_undefs.hpp
18644 /*
18645 未完成的elc解释器_share文件
18646 由steve02081504与Alex0125设计、编写
18647 转载时请在不对此文件做任何修改的同时注明出处
18648 项目地址:https://github.com/steve02081504/ELC
18649 */
18650
18651 //defs at "_defs.hpp"
18652
18653 #if defined(_MSC_VER)
18654 #pragma warning(pop)
18655 #endif
18656 #undef suppress_msvc_warning
18657 #undef disable_msvc_warning
18658 #undef push_msvc_warning
18659 #undef pop_msvc_warning
18660 #undef push_and_disable_msvc_warning
18661
18662 //for basic_environment.hpp
18663 #undef BIT_POSSIBILITY
18664 //
18665 #if defined(ELC_VOID_NAME)
18666 #define void the_void
18667 #endif
18668
18669 // #undef often_noexcept
18670 #undef noexcept_as
18671 #undef noexcept_as_auto
18672 #undef constexpr_as
18673 #undef constexpr_as_auto
18674
18675 #undef using_method_from_base_t
18676 #undef using_method_from_value
18677
18678 #undef floop
18679 #undef enable_adl
18680
18681 #undef re_declvalue
18682 #undef re_decltype
18683
18684 #undef declvalue
18685
18686 #undef template_error
18687 #undef template_warning
18688
18689 #undef type_info_of
18690 #undef type_name_of
18691
18692 #undef is_common_attribute
18693 #undef is_special_attribute
18694
18695 #undef has_attribute
18696 #undef not_has_attribute
18697
18698 #undef float_size_of
18699 #undef bitnum_of
18700
18701 #undef def_common_attribute_with_nothing
18702 #undef def_special_attribute_with_nothing
18703
18704 #undef common_attribute_t
18705 #undef special_attribute_t
18706
18707 #undef enable_if
18708 #undef enabled_by_default
18709 #undef disabled_by_default
18710 #undef enable_if_not_ill_form
18711 #undef enable_flag
18712
18713 #undef was_an_ill_form
18714 #undef was_an_ill_form_with_parameter
18715 #undef was_not_an_ill_form
18716 #undef was_not_an_ill_form_and_noexcept
18717 #undef was_not_an_ill_form_with_parameter
18718
18719 #undef recursive_lambda
18720 #undef get_recursive_lambda_caller
18721 #undef lambda
18722 #undef lambda_with_catch
18723 #undef self_recursion
18724 #undef lambda_RLSRRS
18725
18726 #undef MAGIC
18727
18728 #undef nothing
18729
18730 #undef elseif
18731 #undef _big_than_
18732 #undef _small_than_
18733
18734 #if defined(_MSC_VER)
18735 #undef not
18736 #undef and
18737 #undef or
18738 #endif
18739
18740 #undef INTER_NAMESPACE
18741 #undef BREAK_NAMESPACE
18742
18743 #undef szie
18744 #undef form
18745
18746 #undef template_name
18747 #undef type_name
18748
18749 #undef not_in_debug
18750
18751 #undef es
18752 #undef ec
18753
18754 #undef ELC_TEST_EVENTNAME
18755
18756 #undef override_instance_struct
18757
18758 #undef distinctive
18759
18760 #undef force_inline
18761
18762 #undef with_no_vtable
18763
18764 #undef in_consteval
18765
18766 #undef no_vtable_struct
18767 #undef no_vtable_class
18768
18769 //file_end
18770
18771 #line 65 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/str_code_convert.hpp"
18772 }
18773 namespace elc::defs{
18774 using namespace elc::APIs::str_code_convert;
18775 }
18776 #endif
18777
18778 //file_end
18779
18780 #line 19 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/_body.hpp"
18781 namespace elc::defs{
18782 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
18783 //_defs.hpp
18784 /*
18785 未完成的elc解释器basic文件
18786 由steve02081504与Alex0125设计、编写
18787 转载时请在不对此文件做任何修改的同时注明出处
18788 项目地址:https://github.com/steve02081504/ELC
18789 */
18790 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
18791 //_defs.hpp
18792 /*
18793 未完成的elc解释器_share文件
18794 由steve02081504与Alex0125设计、编写
18795 转载时请在不对此文件做任何修改的同时注明出处
18796 项目地址:https://github.com/steve02081504/ELC
18797 */
18798
18799 //undefs at "_undefs.hpp"
18800
18801 //set ELC_WARNING_LEVEL default to 4(max)
18802 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
18803
18804 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/basic_environment.hpp"
18805 //basic_environment.hpp
18806 /*
18807 未完成的elc解释器_share文件
18808 由steve02081504与Alex0125设计、编写
18809 转载时请在不对此文件做任何修改的同时注明出处
18810 项目地址:https://github.com/steve02081504/ELC
18811 */
18812
18815 #define BIT_POSSIBILITY 2
18816
18817 //file_end
18818
18819 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
18820
18821 #if defined(_MSC_VER)
18822 #pragma warning(push,ELC_WARNING_LEVEL)
18823 #pragma warning(disable:4099)//class与struct混用警告diss
18824 #pragma warning(disable:26812)//enum class安利diss.
18825 #pragma warning(disable:4584)//重复子类警告diss
18826 #pragma warning(disable:4250)//域控制继承警告diss
18827 #pragma warning(disable:26432)//不完全默认方法警告diss
18828 #pragma warning(disable:26435)//virtual override方法警告diss
18829 #pragma warning(disable:26481)//容器安利diss
18830 #pragma warning(disable:26446)//gsl::at安利diss
18831 #pragma warning(disable:26434)//方法覆盖警告diss
18832 #pragma warning(disable:26429)//gsl::not_null安利diss
18833 #pragma warning(disable:26471)//对void*进行static_cast安利diss
18834 #pragma warning(disable:26474)//隐式指针转换显式cast警告diss
18835 #pragma warning(disable:26473)//相同指针显式cast警告diss
18836 #pragma warning(disable:26456)//隐藏非虚运算符警告diss
18837 #pragma warning(disable:26485)//数组作指针警告diss
18838 #pragma warning(disable:26490)//reinterpret_cast警告diss
18839 #pragma warning(disable:26472)//static_cast窄幅转换警告diss
18840 #pragma warning(disable:26482)//非常数数组索引警告diss
18841 #pragma warning(disable:26493)//c_cast转换警告diss:虽然有用但是太烦了,爬
18842 #endif
18843 #if defined(_MSC_VER)
18844 #define suppress_msvc_warning(...) __pragma(warning(suppress:__VA_ARGS__))
18845 #define disable_msvc_warning(...) __pragma(warning(disable:__VA_ARGS__))
18846 #define push_msvc_warning() __pragma(warning(push))
18847 #define pop_msvc_warning() __pragma(warning(pop))
18848 #define push_and_disable_msvc_warning(...) push_msvc_warning() disable_msvc_warning(__VA_ARGS__)
18849 #else
18850 #define suppress_msvc_warning(...)
18851 #define disable_msvc_warning(...)
18852 #define push_msvc_warning()
18853 #define pop_msvc_warning()
18854 #define push_and_disable_msvc_warning(...)
18855 #endif
18856 //
18857 #if defined(ELC_VOID_NAME)
18858 #undef void
18859 #endif
18860
18861 // #define often_noexcept
18862 #define noexcept_as(...) noexcept(noexcept((__VA_ARGS__)))//dnmd C艹标准就是没有noexcept_as_auto
18863 #define noexcept_as_auto MAGIC//哦现在有了
18864 #define constexpr_as(...) MAGIC constexpr//( •̀ ω •́ )✌
18865 #define constexpr_as_auto MAGIC MAGIC constexpr//✌( •̀ ω •́ )✌
18866
18867 #define using_method_from_base_t(name,...) \
18868 template<class...Args> requires was_not_an_ill_form(declvalue(base_t).name(declvalue(Args)...))\
18869 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(base_t::name(declvalue(Args)...))\
18870 {\
18871 return base_t::name(forward<Args>(rest)...);\
18872 }\
18873
18874 #define using_method_from_value(name,value_name,...) \
18875 template<class...Args> requires was_not_an_ill_form(re_declvalue(value_name).name(declvalue(Args)...))\
18876 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(re_declvalue(value_name).name(declvalue(Args)...))\
18877 {\
18878 return value_name.name(forward<Args>(rest)...);\
18879 }\
18880
18881 #define floop while(__builtin_is_my_dick_still_there())
18882 #define enable_adl(name) void name()noexcept=delete
18883
18884 #define re_declvalue(...) (declvalue(decltype(__VA_ARGS__)))
18885 #define re_decltype(...) (decltype(declvalue(__VA_ARGS__)))
18886
18887 #define declvalue(...) (::std::declval<__VA_ARGS__>())
18888
18890 #define template_error(reason) static_assert(template_error_helper<T>,reason)
18892 #define template_warning(reason) template_warning_helper<T>(reason)
18893
18894 //for type_info
18895 #define type_info_of(...) base_type_info_t(typeid(__VA_ARGS__))
18896 #define type_name_of(...) (type_info_of(__VA_ARGS__).name())
18897
18898 #define is_common_attribute(name) public attribute<T,name<T>>
18899 #define is_special_attribute(name) public attribute<T,name>
18900
18901 #define has_attribute(...) template_name has_attribute_helper<__VA_ARGS__>()
18902 #define not_has_attribute(...) template_name not_has_has_attribute_helper<__VA_ARGS__>()
18903
18904 //for float_size_t
18905 #define float_size_of(...) (float_size_t{sizeof(__VA_ARGS__)})
18906 //bitnum_of
18907 #define bitnum_of(...) (bitnumof<__VA_ARGS__>)
18908
18909 //for attribute
18910 #define def_common_attribute_with_nothing(name) \
18911 template<typename T>\
18912 class name{}\
18913
18914 #define def_special_attribute_with_nothing(name) \
18915 class name{}\
18916
18917 #define common_attribute_t template<class>class
18918 #define special_attribute_t class
18919
18928 #define enable_if(...) class enable_state= ::std::enable_if_t<__VA_ARGS__>
18930 #define enabled_by_default class enable_state=void
18932 #define disabled_by_default class enable_state= ::std::enable_if_t<false>
18934 #define enable_if_not_ill_form(...) class enable_state= ::std::void_t<decltype(__VA_ARGS__)>
18936 #define enable_flag class enable_state
18937
18938 #define was_an_ill_form(...) (!was_not_an_ill_form(__VA_ARGS__))
18939 #define was_an_ill_form_with_parameter(...) (!was_not_an_ill_form_with_parameter(__VA_ARGS__))
18940 #define was_not_an_ill_form(...) (bool(requires{__VA_ARGS__;}))
18941 #define was_not_an_ill_form_and_noexcept(...) (bool(requires{__VA_ARGS__;{__VA_ARGS__}noexcept;}))
18942 #define was_not_an_ill_form_with_parameter(...) (bool(requires __VA_ARGS__ ))
18943
18945 #define recursive_lambda(...) lambda(auto&&lambda_RLSRRS,__VA_ARGS__)
18947 #define get_recursive_lambda_caller(name) \
18948 lambda_with_catch(&)(auto&&...Args){\
18949 return name(name,Args...);\
18950 }
18952 #define lambda []
18954 #define lambda_with_catch(...) [__VA_ARGS__]
18956 #define self_recursion(...) lambda_RLSRRS(lambda_RLSRRS,__VA_ARGS__)
18957 //recursive_lambda_self_referential_reserved_symbolname
18958 #define lambda_RLSRRS _my_jb_super_sb_name_
18959
18960 #define MAGIC//ahh,ko no tenno da!
18961
18963 #define nothing
18964
18966 #define elseif else if
18968 #define _big_than_ >
18970 #define _small_than_ <
18971
18972 #if defined(_MSC_VER)
18973 #define not !
18974 #define and &&
18975 #define or ||
18976 #endif
18977
18979 #define INTER_NAMESPACE(NAMESPACENAME) namespace NAMESPACENAME{
18981 #define BREAK_NAMESPACE }
18982
18984 #define template_name template
18986 #define type_name class
18987
18988 #if defined(DEBUG) || defined(_DEBUG)
18989 #define not_in_debug 0
18990 #else
18991 #define not_in_debug 1
18992 #endif
18993
18994 #define es U""
18995 #define ec(ch) U ## ch
18996
18997 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
18998 #define ELC_TEST_EVENTNAME(name) stest_eventer _the_stest_eventer__(L""name)
18999 #else
19000 #define ELC_TEST_EVENTNAME(name)
19001 #endif
19002
19003 #define override_instance_struct \
19004 protected:\
19005 virtual void abstract_method_unget_this()noexcept_as(instance_struct<this_t>::abstract_method_unget_this())override{instance_struct<this_t>::abstract_method_unget_this();}\
19006 virtual void* _abstract_method_copy_get_this()noexcept_as(instance_struct<this_t>::_abstract_method_copy_get_this())override{return instance_struct<this_t>::_abstract_method_copy_get_this();}\
19007 virtual void* _abstract_method_get_resize_this(size_t size)noexcept_as(instance_struct<this_t>::instance_struct<this_t>::_abstract_method_get_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_resize_this(size);}\
19008 virtual void* _abstract_method_get_forward_resize_this(size_t size)noexcept_as(instance_struct<this_t>::_abstract_method_get_forward_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_forward_resize_this(size);}\
19009 virtual size_t abstract_method_get_size_of_get_for_this()noexcept override{return instance_struct<this_t>::abstract_method_get_size_of_get_for_this();}
19010
19011 #if defined(_WIN32)
19012 #define distinctive __declspec(dllexport)
19013 #else
19014 #define distinctive
19015 #endif
19016
19017 #if defined(_WIN32)
19018 #define force_inline __forceinline
19019 #elif defined(__GNUC__)
19020 #define force_inline __attribute__((always_inline)) inline
19021 #else
19022 #define force_inline inline
19023 #endif
19024
19025 #if defined(_WIN32)
19026 #define with_no_vtable __declspec(novtable)
19027 #else
19028 #define with_no_vtable
19029 #endif
19030
19031 #define in_consteval (::std::is_constant_evaluated())
19032
19033 #define no_vtable_struct struct with_no_vtable
19034 #define no_vtable_class class with_no_vtable
19035
19036 //file_end
19037
19038 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
19039
19040 //file_end
19041
19042 #line 21 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/_body.hpp"
19043
19044 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/literal.hpp"
19045 //literal.hpp
19046 //at namespace elc::defs
19047 /*
19048 未完成的elc解释器string文件
19049 由steve02081504与Alex0125设计、编写
19050 转载时请在不对此文件做任何修改的同时注明出处
19051 项目地址:https://github.com/steve02081504/ELC
19052 */
19053 namespace string_n{
19054 template<constexpr_str_n::constexpr_str_t_literal_helper str_helper>
19055 inline constexpr string operator""_elc_string()noexcept{
19056 return string(constexpr_str_n::operator""_constexpr_str<str_helper>());
19057 }
19058 }
19059 using string_n::operator""_elc_string;
19060
19061 //file_end
19062
19063 #line 23 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/_body.hpp"
19064
19065 #if defined(ELC_TEST_ON)
19066 namespace string_part_test{
19067 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/_test.hpp"
19068 //_test.hpp
19069 /*
19070 未完成的elc解释器string文件
19071 由steve02081504与Alex0125设计、编写
19072 转载时请在不对此文件做任何修改的同时注明出处
19073 项目地址:https://github.com/steve02081504/ELC
19074 */
19075 inline void test(){
19076 ELC_TEST_EVENTNAME("string部分测试");
19077 {
19078 {
19079 string_t a=es"";
19080 stest_accert(a.size()==0);
19081 a=es"asd";
19082 stest_accert(a.size()==3);
19083 a=es"asd"+a;
19084 stest_accert(a.size()==6);
19085 a+=es"asd";
19086 stest_accert(es"asd"+a==es"asdasdasdasd");
19087 a[1]=ec('e');
19088 stest_accert(a.substr(0,3)==es"aed");
19089 stest_accert(a.substr(3).size()==6);
19090 stest_accert(a[2]==ec('d'));
19091 a.clear();
19092 stest_accert(a.size()==0);
19093 a.resize(3,ec('d'));
19094 stest_accert(a==es"ddd");
19095 for(const char_t&c:a)
19096 stest_accert(c==ec('d'));
19097 a=es"abc";
19098 stest_accert(a.begin()==a.cbegin());
19099 stest_accert(*a.begin()==ec('a'));
19100 stest_accert(a.begin()<=a.cend());
19101 stest_accert(*a.rbegin()==ec('c'));
19102 stest_accert(a.rbegin()<=a.rend());
19103 stest_accert(a.rbegin()==a.end()-1);
19104 a.push_back(es"as");
19105 a.push_front(ec('p'));
19106 stest_accert(a == es"pabcas");
19107 a.erase(1,3);
19108 a.erase(1);
19109 stest_accert(a == es"ps");
19110 stest_accert(a.pop_front() == ec('p'));
19111 stest_accert(a.pop_back() == ec('s'));
19112 stest_accert(a.size() == 0);
19113 a=es"abc";
19114 stest_accert(a.pop_back(2) == es"bc");
19115 stest_accert(a.size() == 1);
19116 a.push_front(es"wqer");
19117 stest_accert(a==es"wqera");
19118 a.insert(2,es"123");
19119 a.insert(0,es"123");
19120 a.insert(a.size(),es"123");
19121 stest_accert(a[2] == ec('3'));
19122 a[5]=ec('6');
19123 a[6]=ec('6');
19124 a[7]=ec('6');
19125 a[8]=ec('6');
19126 stest_accert(a == es"123wq6666ra123");
19127 for(char_t& c: a.view())
19128 c ='7';
19129 stest_accert(a == es"77777777777777");
19130 }
19131 {
19132 using namespace elc;
19133 using elc::defs::hash;
19134 auto a = es"ab"_elc_string;//constexpr_string_data_t
19135 stest_accert(hash(a) == hash(string_view(es"ab")));
19136 string b = es"ab";//comn_string_data_t
19137 stest_accert(hash(b) == hash(string_view(es"ab")));
19138 stest_accert(b.memory_cost() > a.memory_cost());
19139 a += b;//sum_string_data_t -> constexpr_string_data_t
19140 // -> comn_string_data_t
19141 stest_accert(hash(a) == hash(string_view(es"abab")));
19142 a.insert(1, 'c');//inserted_string_data_t -> sum_string_data_t
19143 stest_accert(hash(a) == hash(string_view(es"acbab")));
19144 a.erase(2, 3);//erased_string_data_t -> inserted_string_data_t
19145 stest_accert(hash(a) == hash(string_view(es"ac")));
19146 a.push_back(es"123");//end_apply_string_data_t -> erased_string_data_t
19147 stest_accert(hash(a) == hash(string_view(es"ac123")));
19148 a.push_front(es"123");//head_apply_string_data_t -> end_apply_string_data_t
19149 stest_accert(hash(a) == hash(string_view(es"123ac123")));
19150 }
19151 }
19152 check_memory_lack();
19153 }
19154 inline void test_log_out(){
19155 }
19156 inline void test_end(){
19157 }
19158
19159 //file_end
19160
19161 #line 27 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/_body.hpp"
19162 }
19163 #endif
19164
19165 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
19166 //_undefs.hpp
19167 /*
19168 未完成的elc解释器basic文件
19169 由steve02081504与Alex0125设计、编写
19170 转载时请在不对此文件做任何修改的同时注明出处
19171 项目地址:https://github.com/steve02081504/ELC
19172 */
19173 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_undefs.hpp"
19174 //_undefs.hpp
19175 /*
19176 未完成的elc解释器_share文件
19177 由steve02081504与Alex0125设计、编写
19178 转载时请在不对此文件做任何修改的同时注明出处
19179 项目地址:https://github.com/steve02081504/ELC
19180 */
19181
19182 //defs at "_defs.hpp"
19183
19184 #if defined(_MSC_VER)
19185 #pragma warning(pop)
19186 #endif
19187 #undef suppress_msvc_warning
19188 #undef disable_msvc_warning
19189 #undef push_msvc_warning
19190 #undef pop_msvc_warning
19191 #undef push_and_disable_msvc_warning
19192
19193 //for basic_environment.hpp
19194 #undef BIT_POSSIBILITY
19195 //
19196 #if defined(ELC_VOID_NAME)
19197 #define void the_void
19198 #endif
19199
19200 // #undef often_noexcept
19201 #undef noexcept_as
19202 #undef noexcept_as_auto
19203 #undef constexpr_as
19204 #undef constexpr_as_auto
19205
19206 #undef using_method_from_base_t
19207 #undef using_method_from_value
19208
19209 #undef floop
19210 #undef enable_adl
19211
19212 #undef re_declvalue
19213 #undef re_decltype
19214
19215 #undef declvalue
19216
19217 #undef template_error
19218 #undef template_warning
19219
19220 #undef type_info_of
19221 #undef type_name_of
19222
19223 #undef is_common_attribute
19224 #undef is_special_attribute
19225
19226 #undef has_attribute
19227 #undef not_has_attribute
19228
19229 #undef float_size_of
19230 #undef bitnum_of
19231
19232 #undef def_common_attribute_with_nothing
19233 #undef def_special_attribute_with_nothing
19234
19235 #undef common_attribute_t
19236 #undef special_attribute_t
19237
19238 #undef enable_if
19239 #undef enabled_by_default
19240 #undef disabled_by_default
19241 #undef enable_if_not_ill_form
19242 #undef enable_flag
19243
19244 #undef was_an_ill_form
19245 #undef was_an_ill_form_with_parameter
19246 #undef was_not_an_ill_form
19247 #undef was_not_an_ill_form_and_noexcept
19248 #undef was_not_an_ill_form_with_parameter
19249
19250 #undef recursive_lambda
19251 #undef get_recursive_lambda_caller
19252 #undef lambda
19253 #undef lambda_with_catch
19254 #undef self_recursion
19255 #undef lambda_RLSRRS
19256
19257 #undef MAGIC
19258
19259 #undef nothing
19260
19261 #undef elseif
19262 #undef _big_than_
19263 #undef _small_than_
19264
19265 #if defined(_MSC_VER)
19266 #undef not
19267 #undef and
19268 #undef or
19269 #endif
19270
19271 #undef INTER_NAMESPACE
19272 #undef BREAK_NAMESPACE
19273
19274 #undef szie
19275 #undef form
19276
19277 #undef template_name
19278 #undef type_name
19279
19280 #undef not_in_debug
19281
19282 #undef es
19283 #undef ec
19284
19285 #undef ELC_TEST_EVENTNAME
19286
19287 #undef override_instance_struct
19288
19289 #undef distinctive
19290
19291 #undef force_inline
19292
19293 #undef with_no_vtable
19294
19295 #undef in_consteval
19296
19297 #undef no_vtable_struct
19298 #undef no_vtable_class
19299
19300 //file_end
19301
19302 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
19303
19304 //file_end
19305
19306 #line 31 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/_body.hpp"
19307 }
19308 namespace elc{
19309 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/_export.hpp"
19310 //_export.hpp
19311 //at namespace elc
19312 /*
19313 未完成的elc解释器string文件
19314 由steve02081504与Alex0125设计、编写
19315 转载时请在不对此文件做任何修改的同时注明出处
19316 项目地址:https://github.com/steve02081504/ELC
19317 */
19318 #define export using defs::
19320 export string;
19321 export string_view_t;
19323 export operator""_elc_string;
19324 export operator""_constexpr_str;
19325 #undef export
19326
19327 //file_end
19328
19329 #line 34 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/_body.hpp"
19330 }
19331 #if defined(ELC_CORE)
19332 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_multi/string_arec_as_value.hpp"
19333 //string_arec_as_value.hpp
19334 //at namespace ::
19335 //multi when ELC_STRING & ELC_CORE
19336 /*
19337 未完成的elc解释器string文件
19338 由steve02081504与Alex0125设计、编写
19339 转载时请在不对此文件做任何修改的同时注明出处
19340 项目地址:https://github.com/steve02081504/ELC
19341 */
19342 namespace elc::defs{
19343 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
19344 //_defs.hpp
19345 /*
19346 未完成的elc解释器basic文件
19347 由steve02081504与Alex0125设计、编写
19348 转载时请在不对此文件做任何修改的同时注明出处
19349 项目地址:https://github.com/steve02081504/ELC
19350 */
19351 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
19352 //_defs.hpp
19353 /*
19354 未完成的elc解释器_share文件
19355 由steve02081504与Alex0125设计、编写
19356 转载时请在不对此文件做任何修改的同时注明出处
19357 项目地址:https://github.com/steve02081504/ELC
19358 */
19359
19360 //undefs at "_undefs.hpp"
19361
19362 //set ELC_WARNING_LEVEL default to 4(max)
19363 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
19364
19365 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/basic_environment.hpp"
19366 //basic_environment.hpp
19367 /*
19368 未完成的elc解释器_share文件
19369 由steve02081504与Alex0125设计、编写
19370 转载时请在不对此文件做任何修改的同时注明出处
19371 项目地址:https://github.com/steve02081504/ELC
19372 */
19373
19376 #define BIT_POSSIBILITY 2
19377
19378 //file_end
19379
19380 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
19381
19382 #if defined(_MSC_VER)
19383 #pragma warning(push,ELC_WARNING_LEVEL)
19384 #pragma warning(disable:4099)//class与struct混用警告diss
19385 #pragma warning(disable:26812)//enum class安利diss.
19386 #pragma warning(disable:4584)//重复子类警告diss
19387 #pragma warning(disable:4250)//域控制继承警告diss
19388 #pragma warning(disable:26432)//不完全默认方法警告diss
19389 #pragma warning(disable:26435)//virtual override方法警告diss
19390 #pragma warning(disable:26481)//容器安利diss
19391 #pragma warning(disable:26446)//gsl::at安利diss
19392 #pragma warning(disable:26434)//方法覆盖警告diss
19393 #pragma warning(disable:26429)//gsl::not_null安利diss
19394 #pragma warning(disable:26471)//对void*进行static_cast安利diss
19395 #pragma warning(disable:26474)//隐式指针转换显式cast警告diss
19396 #pragma warning(disable:26473)//相同指针显式cast警告diss
19397 #pragma warning(disable:26456)//隐藏非虚运算符警告diss
19398 #pragma warning(disable:26485)//数组作指针警告diss
19399 #pragma warning(disable:26490)//reinterpret_cast警告diss
19400 #pragma warning(disable:26472)//static_cast窄幅转换警告diss
19401 #pragma warning(disable:26482)//非常数数组索引警告diss
19402 #pragma warning(disable:26493)//c_cast转换警告diss:虽然有用但是太烦了,爬
19403 #endif
19404 #if defined(_MSC_VER)
19405 #define suppress_msvc_warning(...) __pragma(warning(suppress:__VA_ARGS__))
19406 #define disable_msvc_warning(...) __pragma(warning(disable:__VA_ARGS__))
19407 #define push_msvc_warning() __pragma(warning(push))
19408 #define pop_msvc_warning() __pragma(warning(pop))
19409 #define push_and_disable_msvc_warning(...) push_msvc_warning() disable_msvc_warning(__VA_ARGS__)
19410 #else
19411 #define suppress_msvc_warning(...)
19412 #define disable_msvc_warning(...)
19413 #define push_msvc_warning()
19414 #define pop_msvc_warning()
19415 #define push_and_disable_msvc_warning(...)
19416 #endif
19417 //
19418 #if defined(ELC_VOID_NAME)
19419 #undef void
19420 #endif
19421
19422 // #define often_noexcept
19423 #define noexcept_as(...) noexcept(noexcept((__VA_ARGS__)))//dnmd C艹标准就是没有noexcept_as_auto
19424 #define noexcept_as_auto MAGIC//哦现在有了
19425 #define constexpr_as(...) MAGIC constexpr//( •̀ ω •́ )✌
19426 #define constexpr_as_auto MAGIC MAGIC constexpr//✌( •̀ ω •́ )✌
19427
19428 #define using_method_from_base_t(name,...) \
19429 template<class...Args> requires was_not_an_ill_form(declvalue(base_t).name(declvalue(Args)...))\
19430 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(base_t::name(declvalue(Args)...))\
19431 {\
19432 return base_t::name(forward<Args>(rest)...);\
19433 }\
19434
19435 #define using_method_from_value(name,value_name,...) \
19436 template<class...Args> requires was_not_an_ill_form(re_declvalue(value_name).name(declvalue(Args)...))\
19437 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(re_declvalue(value_name).name(declvalue(Args)...))\
19438 {\
19439 return value_name.name(forward<Args>(rest)...);\
19440 }\
19441
19442 #define floop while(__builtin_is_my_dick_still_there())
19443 #define enable_adl(name) void name()noexcept=delete
19444
19445 #define re_declvalue(...) (declvalue(decltype(__VA_ARGS__)))
19446 #define re_decltype(...) (decltype(declvalue(__VA_ARGS__)))
19447
19448 #define declvalue(...) (::std::declval<__VA_ARGS__>())
19449
19451 #define template_error(reason) static_assert(template_error_helper<T>,reason)
19453 #define template_warning(reason) template_warning_helper<T>(reason)
19454
19455 //for type_info
19456 #define type_info_of(...) base_type_info_t(typeid(__VA_ARGS__))
19457 #define type_name_of(...) (type_info_of(__VA_ARGS__).name())
19458
19459 #define is_common_attribute(name) public attribute<T,name<T>>
19460 #define is_special_attribute(name) public attribute<T,name>
19461
19462 #define has_attribute(...) template_name has_attribute_helper<__VA_ARGS__>()
19463 #define not_has_attribute(...) template_name not_has_has_attribute_helper<__VA_ARGS__>()
19464
19465 //for float_size_t
19466 #define float_size_of(...) (float_size_t{sizeof(__VA_ARGS__)})
19467 //bitnum_of
19468 #define bitnum_of(...) (bitnumof<__VA_ARGS__>)
19469
19470 //for attribute
19471 #define def_common_attribute_with_nothing(name) \
19472 template<typename T>\
19473 class name{}\
19474
19475 #define def_special_attribute_with_nothing(name) \
19476 class name{}\
19477
19478 #define common_attribute_t template<class>class
19479 #define special_attribute_t class
19480
19489 #define enable_if(...) class enable_state= ::std::enable_if_t<__VA_ARGS__>
19491 #define enabled_by_default class enable_state=void
19493 #define disabled_by_default class enable_state= ::std::enable_if_t<false>
19495 #define enable_if_not_ill_form(...) class enable_state= ::std::void_t<decltype(__VA_ARGS__)>
19497 #define enable_flag class enable_state
19498
19499 #define was_an_ill_form(...) (!was_not_an_ill_form(__VA_ARGS__))
19500 #define was_an_ill_form_with_parameter(...) (!was_not_an_ill_form_with_parameter(__VA_ARGS__))
19501 #define was_not_an_ill_form(...) (bool(requires{__VA_ARGS__;}))
19502 #define was_not_an_ill_form_and_noexcept(...) (bool(requires{__VA_ARGS__;{__VA_ARGS__}noexcept;}))
19503 #define was_not_an_ill_form_with_parameter(...) (bool(requires __VA_ARGS__ ))
19504
19506 #define recursive_lambda(...) lambda(auto&&lambda_RLSRRS,__VA_ARGS__)
19508 #define get_recursive_lambda_caller(name) \
19509 lambda_with_catch(&)(auto&&...Args){\
19510 return name(name,Args...);\
19511 }
19513 #define lambda []
19515 #define lambda_with_catch(...) [__VA_ARGS__]
19517 #define self_recursion(...) lambda_RLSRRS(lambda_RLSRRS,__VA_ARGS__)
19518 //recursive_lambda_self_referential_reserved_symbolname
19519 #define lambda_RLSRRS _my_jb_super_sb_name_
19520
19521 #define MAGIC//ahh,ko no tenno da!
19522
19524 #define nothing
19525
19527 #define elseif else if
19529 #define _big_than_ >
19531 #define _small_than_ <
19532
19533 #if defined(_MSC_VER)
19534 #define not !
19535 #define and &&
19536 #define or ||
19537 #endif
19538
19540 #define INTER_NAMESPACE(NAMESPACENAME) namespace NAMESPACENAME{
19542 #define BREAK_NAMESPACE }
19543
19545 #define template_name template
19547 #define type_name class
19548
19549 #if defined(DEBUG) || defined(_DEBUG)
19550 #define not_in_debug 0
19551 #else
19552 #define not_in_debug 1
19553 #endif
19554
19555 #define es U""
19556 #define ec(ch) U ## ch
19557
19558 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
19559 #define ELC_TEST_EVENTNAME(name) stest_eventer _the_stest_eventer__(L""name)
19560 #else
19561 #define ELC_TEST_EVENTNAME(name)
19562 #endif
19563
19564 #define override_instance_struct \
19565 protected:\
19566 virtual void abstract_method_unget_this()noexcept_as(instance_struct<this_t>::abstract_method_unget_this())override{instance_struct<this_t>::abstract_method_unget_this();}\
19567 virtual void* _abstract_method_copy_get_this()noexcept_as(instance_struct<this_t>::_abstract_method_copy_get_this())override{return instance_struct<this_t>::_abstract_method_copy_get_this();}\
19568 virtual void* _abstract_method_get_resize_this(size_t size)noexcept_as(instance_struct<this_t>::instance_struct<this_t>::_abstract_method_get_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_resize_this(size);}\
19569 virtual void* _abstract_method_get_forward_resize_this(size_t size)noexcept_as(instance_struct<this_t>::_abstract_method_get_forward_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_forward_resize_this(size);}\
19570 virtual size_t abstract_method_get_size_of_get_for_this()noexcept override{return instance_struct<this_t>::abstract_method_get_size_of_get_for_this();}
19571
19572 #if defined(_WIN32)
19573 #define distinctive __declspec(dllexport)
19574 #else
19575 #define distinctive
19576 #endif
19577
19578 #if defined(_WIN32)
19579 #define force_inline __forceinline
19580 #elif defined(__GNUC__)
19581 #define force_inline __attribute__((always_inline)) inline
19582 #else
19583 #define force_inline inline
19584 #endif
19585
19586 #if defined(_WIN32)
19587 #define with_no_vtable __declspec(novtable)
19588 #else
19589 #define with_no_vtable
19590 #endif
19591
19592 #define in_consteval (::std::is_constant_evaluated())
19593
19594 #define no_vtable_struct struct with_no_vtable
19595 #define no_vtable_class class with_no_vtable
19596
19597 //file_end
19598
19599 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
19600
19601 //file_end
19602
19603 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_multi/string_arec_as_value.hpp"
19604
19605 namespace string_n{
19606 template<class char_T>
19607 value arec_as_value(string_t<char_T>&str,const value index){
19608 size_t i=size_t(use_as<int_t>(index));
19609 if(!i)
19610 i=size_t(use_as<uint_t>(index));
19611 struct arec_data_t final:instance_struct<arec_data_t>
19612 ,value::base_data_t{
19614 arec_data_t(string_t<char_T>&str,size_t index)noexcept:_m(&str,index){};
19615 arec_data_t(const arec_data_t&ref)noexcept:_m(special_init,ref._m){}
19616 virtual ~arec_data_t()noexcept override final=default;
19617
19618 virtual void be_set(ptr a)noexcept override final{move(_m)=use_as<char_T>(a);}
19619 [[nodiscard]]virtual ptr get_value()noexcept override final{return core::make_binary_node_from<char_T>(move(_m));}
19620 [[nodiscard]]virtual base_data_t*copy()const noexcept override final{return get<arec_data_t>(*this);}
19621 [[nodiscard]]virtual base_type_info_t get_type_info()const noexcept override final{return type_info<arec_data_t>;}
19622 };
19623 return get<arec_data_t>(str,i);
19624 }
19625 }
19626
19627 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
19628 //_undefs.hpp
19629 /*
19630 未完成的elc解释器basic文件
19631 由steve02081504与Alex0125设计、编写
19632 转载时请在不对此文件做任何修改的同时注明出处
19633 项目地址:https://github.com/steve02081504/ELC
19634 */
19635 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_undefs.hpp"
19636 //_undefs.hpp
19637 /*
19638 未完成的elc解释器_share文件
19639 由steve02081504与Alex0125设计、编写
19640 转载时请在不对此文件做任何修改的同时注明出处
19641 项目地址:https://github.com/steve02081504/ELC
19642 */
19643
19644 //defs at "_defs.hpp"
19645
19646 #if defined(_MSC_VER)
19647 #pragma warning(pop)
19648 #endif
19649 #undef suppress_msvc_warning
19650 #undef disable_msvc_warning
19651 #undef push_msvc_warning
19652 #undef pop_msvc_warning
19653 #undef push_and_disable_msvc_warning
19654
19655 //for basic_environment.hpp
19656 #undef BIT_POSSIBILITY
19657 //
19658 #if defined(ELC_VOID_NAME)
19659 #define void the_void
19660 #endif
19661
19662 // #undef often_noexcept
19663 #undef noexcept_as
19664 #undef noexcept_as_auto
19665 #undef constexpr_as
19666 #undef constexpr_as_auto
19667
19668 #undef using_method_from_base_t
19669 #undef using_method_from_value
19670
19671 #undef floop
19672 #undef enable_adl
19673
19674 #undef re_declvalue
19675 #undef re_decltype
19676
19677 #undef declvalue
19678
19679 #undef template_error
19680 #undef template_warning
19681
19682 #undef type_info_of
19683 #undef type_name_of
19684
19685 #undef is_common_attribute
19686 #undef is_special_attribute
19687
19688 #undef has_attribute
19689 #undef not_has_attribute
19690
19691 #undef float_size_of
19692 #undef bitnum_of
19693
19694 #undef def_common_attribute_with_nothing
19695 #undef def_special_attribute_with_nothing
19696
19697 #undef common_attribute_t
19698 #undef special_attribute_t
19699
19700 #undef enable_if
19701 #undef enabled_by_default
19702 #undef disabled_by_default
19703 #undef enable_if_not_ill_form
19704 #undef enable_flag
19705
19706 #undef was_an_ill_form
19707 #undef was_an_ill_form_with_parameter
19708 #undef was_not_an_ill_form
19709 #undef was_not_an_ill_form_and_noexcept
19710 #undef was_not_an_ill_form_with_parameter
19711
19712 #undef recursive_lambda
19713 #undef get_recursive_lambda_caller
19714 #undef lambda
19715 #undef lambda_with_catch
19716 #undef self_recursion
19717 #undef lambda_RLSRRS
19718
19719 #undef MAGIC
19720
19721 #undef nothing
19722
19723 #undef elseif
19724 #undef _big_than_
19725 #undef _small_than_
19726
19727 #if defined(_MSC_VER)
19728 #undef not
19729 #undef and
19730 #undef or
19731 #endif
19732
19733 #undef INTER_NAMESPACE
19734 #undef BREAK_NAMESPACE
19735
19736 #undef szie
19737 #undef form
19738
19739 #undef template_name
19740 #undef type_name
19741
19742 #undef not_in_debug
19743
19744 #undef es
19745 #undef ec
19746
19747 #undef ELC_TEST_EVENTNAME
19748
19749 #undef override_instance_struct
19750
19751 #undef distinctive
19752
19753 #undef force_inline
19754
19755 #undef with_no_vtable
19756
19757 #undef in_consteval
19758
19759 #undef no_vtable_struct
19760 #undef no_vtable_class
19761
19762 //file_end
19763
19764 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
19765
19766 //file_end
19767
19768 #line 35 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_multi/string_arec_as_value.hpp"
19769 }
19770
19771 //file_end
19772
19773 #line 37 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/_body.hpp"
19774 #endif
19775
19776 //file_end
19777
19778 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/string"
19779 #endif
19780
19781 //file_end
19782
19783 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/lib_loader"
19784 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/lib_loader/_body.hpp"
19785 //_body.hpp
19786 //at namespace ::
19787 /*
19788 未完成的elc解释器template文件
19789 由steve02081504与Alex0125设计、编写
19790 转载时请在不对此文件做任何修改的同时注明出处
19791 项目地址:https://github.com/steve02081504/ELC
19792 */
19793 #if defined(ELC_TEST)
19794 #error "this part cannot be tested."
19795 #endif
19796 //include APIs:elc中可能根据编译环境而修改的底层函数
19797 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/str_code_convert.hpp"
19798 //str_code_convert.hpp
19799 /*
19800 未完成的elc解释器_share文件
19801 由steve02081504与Alex0125设计、编写
19802 转载时请在不对此文件做任何修改的同时注明出处
19803 项目地址:https://github.com/steve02081504/ELC
19804 */
19805 /*
19806 APIs说明
19807 elc依赖的基础函数.
19808 调整这些,实现快速移植,快速优化与行为自定义.
19809 */
19810 #line 70 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/str_code_convert.hpp"
19811
19812 //file_end
19813
19814 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/lib_loader/_body.hpp"
19815 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/library_load.hpp"
19816 //library_load.hpp
19817 /*
19818 未完成的elc解释器_share文件
19819 由steve02081504与Alex0125设计、编写
19820 转载时请在不对此文件做任何修改的同时注明出处
19821 项目地址:https://github.com/steve02081504/ELC
19822 */
19823 /*
19824 APIs说明
19825 elc依赖的基础函数.
19826 调整这些,实现快速移植,快速优化与行为自定义.
19827 */
19828 #if !defined(ELC_APIS_library_load)
19829 #define ELC_APIS_library_load
19830 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/_tools/decl_system_type.hpp"
19831 //decl_system_type.hpp
19832 /*
19833 未完成的elc解释器_share文件
19834 由steve02081504与Alex0125设计、编写
19835 转载时请在不对此文件做任何修改的同时注明出处
19836 项目地址:https://github.com/steve02081504/ELC
19837 */
19838 //copy&rewrite from steve02081504/steve.h
19839 #define linux 2
19840 #define windows 3
19841 #define other 4
19842 #if defined(__linux)||defined(__linux__)||defined(__gnu_linux__)
19843 #define SYSTEM_TYPE linux
19844 #elif defined(_WIN32)||defined(__MINGW32__)||defined(__CYGWIN__)
19845 #define SYSTEM_TYPE windows
19846 #else
19847 #define SYSTEM_TYPE other
19848 #endif
19849 #define ERROR_MSG_UNABLE_OS "Unable OS,edit this file on your own or contact ELC's producers."
19850
19851 //file_end
19852
19853 #line 15 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/library_load.hpp"
19854 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/string"
19855 //string
19856 //at namespace ::
19857 /*
19858 未完成的elc解释器include文件
19859 由steve02081504与Alex0125设计、编写
19860 转载时请在不对此文件做任何修改的同时注明出处
19861 项目地址:https://github.com/steve02081504/ELC
19862 */
19863 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/string"
19864
19865 //file_end
19866
19867 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/library_load.hpp"
19868 #if SYSTEM_TYPE == linux
19869 #include <dlfcn.h>
19870 #elif SYSTEM_TYPE == windows
19871 #define NOMINMAX
19872 #include <Windows.h>
19873 #include <Libloaderapi.h>
19874 #include <Errhandlingapi.h>//GetLastError
19875 //to_string
19876 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/numerical_representation"
19877 //numerical_representation
19878 //at namespace ::
19879 /*
19880 未完成的elc解释器include文件
19881 由steve02081504与Alex0125设计、编写
19882 转载时请在不对此文件做任何修改的同时注明出处
19883 项目地址:https://github.com/steve02081504/ELC
19884 */
19885 #if !defined(ELC_NUMERICAL_REPRESENTATION)
19886 #define ELC_NUMERICAL_REPRESENTATION
19887 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/string"
19888 //string
19889 //at namespace ::
19890 /*
19891 未完成的elc解释器include文件
19892 由steve02081504与Alex0125设计、编写
19893 转载时请在不对此文件做任何修改的同时注明出处
19894 项目地址:https://github.com/steve02081504/ELC
19895 */
19896 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/string"
19897
19898 //file_end
19899
19900 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/numerical_representation"
19901 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/numerical_representation/_body.hpp"
19902 //_body.hpp
19903 //at namespace ::
19904 /*
19905 未完成的elc解释器numerical_representation文件
19906 由steve02081504与Alex0125设计、编写
19907 转载时请在不对此文件做任何修改的同时注明出处
19908 项目地址:https://github.com/steve02081504/ELC
19909 */
19910 #if defined(ELC_TEST)
19911 #error "this part cannot be tested."
19912 #endif
19913 namespace elc::defs{
19914 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
19915 //_defs.hpp
19916 /*
19917 未完成的elc解释器basic文件
19918 由steve02081504与Alex0125设计、编写
19919 转载时请在不对此文件做任何修改的同时注明出处
19920 项目地址:https://github.com/steve02081504/ELC
19921 */
19922 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
19923 //_defs.hpp
19924 /*
19925 未完成的elc解释器_share文件
19926 由steve02081504与Alex0125设计、编写
19927 转载时请在不对此文件做任何修改的同时注明出处
19928 项目地址:https://github.com/steve02081504/ELC
19929 */
19930
19931 //undefs at "_undefs.hpp"
19932
19933 //set ELC_WARNING_LEVEL default to 4(max)
19934 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
19935
19936 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/basic_environment.hpp"
19937 //basic_environment.hpp
19938 /*
19939 未完成的elc解释器_share文件
19940 由steve02081504与Alex0125设计、编写
19941 转载时请在不对此文件做任何修改的同时注明出处
19942 项目地址:https://github.com/steve02081504/ELC
19943 */
19944
19947 #define BIT_POSSIBILITY 2
19948
19949 //file_end
19950
19951 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
19952
19953 #if defined(_MSC_VER)
19954 #pragma warning(push,ELC_WARNING_LEVEL)
19955 #pragma warning(disable:4099)//class与struct混用警告diss
19956 #pragma warning(disable:26812)//enum class安利diss.
19957 #pragma warning(disable:4584)//重复子类警告diss
19958 #pragma warning(disable:4250)//域控制继承警告diss
19959 #pragma warning(disable:26432)//不完全默认方法警告diss
19960 #pragma warning(disable:26435)//virtual override方法警告diss
19961 #pragma warning(disable:26481)//容器安利diss
19962 #pragma warning(disable:26446)//gsl::at安利diss
19963 #pragma warning(disable:26434)//方法覆盖警告diss
19964 #pragma warning(disable:26429)//gsl::not_null安利diss
19965 #pragma warning(disable:26471)//对void*进行static_cast安利diss
19966 #pragma warning(disable:26474)//隐式指针转换显式cast警告diss
19967 #pragma warning(disable:26473)//相同指针显式cast警告diss
19968 #pragma warning(disable:26456)//隐藏非虚运算符警告diss
19969 #pragma warning(disable:26485)//数组作指针警告diss
19970 #pragma warning(disable:26490)//reinterpret_cast警告diss
19971 #pragma warning(disable:26472)//static_cast窄幅转换警告diss
19972 #pragma warning(disable:26482)//非常数数组索引警告diss
19973 #pragma warning(disable:26493)//c_cast转换警告diss:虽然有用但是太烦了,爬
19974 #endif
19975 #if defined(_MSC_VER)
19976 #define suppress_msvc_warning(...) __pragma(warning(suppress:__VA_ARGS__))
19977 #define disable_msvc_warning(...) __pragma(warning(disable:__VA_ARGS__))
19978 #define push_msvc_warning() __pragma(warning(push))
19979 #define pop_msvc_warning() __pragma(warning(pop))
19980 #define push_and_disable_msvc_warning(...) push_msvc_warning() disable_msvc_warning(__VA_ARGS__)
19981 #else
19982 #define suppress_msvc_warning(...)
19983 #define disable_msvc_warning(...)
19984 #define push_msvc_warning()
19985 #define pop_msvc_warning()
19986 #define push_and_disable_msvc_warning(...)
19987 #endif
19988 //
19989 #if defined(ELC_VOID_NAME)
19990 #undef void
19991 #endif
19992
19993 // #define often_noexcept
19994 #define noexcept_as(...) noexcept(noexcept((__VA_ARGS__)))//dnmd C艹标准就是没有noexcept_as_auto
19995 #define noexcept_as_auto MAGIC//哦现在有了
19996 #define constexpr_as(...) MAGIC constexpr//( •̀ ω •́ )✌
19997 #define constexpr_as_auto MAGIC MAGIC constexpr//✌( •̀ ω •́ )✌
19998
19999 #define using_method_from_base_t(name,...) \
20000 template<class...Args> requires was_not_an_ill_form(declvalue(base_t).name(declvalue(Args)...))\
20001 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(base_t::name(declvalue(Args)...))\
20002 {\
20003 return base_t::name(forward<Args>(rest)...);\
20004 }\
20005
20006 #define using_method_from_value(name,value_name,...) \
20007 template<class...Args> requires was_not_an_ill_form(re_declvalue(value_name).name(declvalue(Args)...))\
20008 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(re_declvalue(value_name).name(declvalue(Args)...))\
20009 {\
20010 return value_name.name(forward<Args>(rest)...);\
20011 }\
20012
20013 #define floop while(__builtin_is_my_dick_still_there())
20014 #define enable_adl(name) void name()noexcept=delete
20015
20016 #define re_declvalue(...) (declvalue(decltype(__VA_ARGS__)))
20017 #define re_decltype(...) (decltype(declvalue(__VA_ARGS__)))
20018
20019 #define declvalue(...) (::std::declval<__VA_ARGS__>())
20020
20022 #define template_error(reason) static_assert(template_error_helper<T>,reason)
20024 #define template_warning(reason) template_warning_helper<T>(reason)
20025
20026 //for type_info
20027 #define type_info_of(...) base_type_info_t(typeid(__VA_ARGS__))
20028 #define type_name_of(...) (type_info_of(__VA_ARGS__).name())
20029
20030 #define is_common_attribute(name) public attribute<T,name<T>>
20031 #define is_special_attribute(name) public attribute<T,name>
20032
20033 #define has_attribute(...) template_name has_attribute_helper<__VA_ARGS__>()
20034 #define not_has_attribute(...) template_name not_has_has_attribute_helper<__VA_ARGS__>()
20035
20036 //for float_size_t
20037 #define float_size_of(...) (float_size_t{sizeof(__VA_ARGS__)})
20038 //bitnum_of
20039 #define bitnum_of(...) (bitnumof<__VA_ARGS__>)
20040
20041 //for attribute
20042 #define def_common_attribute_with_nothing(name) \
20043 template<typename T>\
20044 class name{}\
20045
20046 #define def_special_attribute_with_nothing(name) \
20047 class name{}\
20048
20049 #define common_attribute_t template<class>class
20050 #define special_attribute_t class
20051
20060 #define enable_if(...) class enable_state= ::std::enable_if_t<__VA_ARGS__>
20062 #define enabled_by_default class enable_state=void
20064 #define disabled_by_default class enable_state= ::std::enable_if_t<false>
20066 #define enable_if_not_ill_form(...) class enable_state= ::std::void_t<decltype(__VA_ARGS__)>
20068 #define enable_flag class enable_state
20069
20070 #define was_an_ill_form(...) (!was_not_an_ill_form(__VA_ARGS__))
20071 #define was_an_ill_form_with_parameter(...) (!was_not_an_ill_form_with_parameter(__VA_ARGS__))
20072 #define was_not_an_ill_form(...) (bool(requires{__VA_ARGS__;}))
20073 #define was_not_an_ill_form_and_noexcept(...) (bool(requires{__VA_ARGS__;{__VA_ARGS__}noexcept;}))
20074 #define was_not_an_ill_form_with_parameter(...) (bool(requires __VA_ARGS__ ))
20075
20077 #define recursive_lambda(...) lambda(auto&&lambda_RLSRRS,__VA_ARGS__)
20079 #define get_recursive_lambda_caller(name) \
20080 lambda_with_catch(&)(auto&&...Args){\
20081 return name(name,Args...);\
20082 }
20084 #define lambda []
20086 #define lambda_with_catch(...) [__VA_ARGS__]
20088 #define self_recursion(...) lambda_RLSRRS(lambda_RLSRRS,__VA_ARGS__)
20089 //recursive_lambda_self_referential_reserved_symbolname
20090 #define lambda_RLSRRS _my_jb_super_sb_name_
20091
20092 #define MAGIC//ahh,ko no tenno da!
20093
20095 #define nothing
20096
20098 #define elseif else if
20100 #define _big_than_ >
20102 #define _small_than_ <
20103
20104 #if defined(_MSC_VER)
20105 #define not !
20106 #define and &&
20107 #define or ||
20108 #endif
20109
20111 #define INTER_NAMESPACE(NAMESPACENAME) namespace NAMESPACENAME{
20113 #define BREAK_NAMESPACE }
20114
20116 #define template_name template
20118 #define type_name class
20119
20120 #if defined(DEBUG) || defined(_DEBUG)
20121 #define not_in_debug 0
20122 #else
20123 #define not_in_debug 1
20124 #endif
20125
20126 #define es U""
20127 #define ec(ch) U ## ch
20128
20129 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
20130 #define ELC_TEST_EVENTNAME(name) stest_eventer _the_stest_eventer__(L""name)
20131 #else
20132 #define ELC_TEST_EVENTNAME(name)
20133 #endif
20134
20135 #define override_instance_struct \
20136 protected:\
20137 virtual void abstract_method_unget_this()noexcept_as(instance_struct<this_t>::abstract_method_unget_this())override{instance_struct<this_t>::abstract_method_unget_this();}\
20138 virtual void* _abstract_method_copy_get_this()noexcept_as(instance_struct<this_t>::_abstract_method_copy_get_this())override{return instance_struct<this_t>::_abstract_method_copy_get_this();}\
20139 virtual void* _abstract_method_get_resize_this(size_t size)noexcept_as(instance_struct<this_t>::instance_struct<this_t>::_abstract_method_get_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_resize_this(size);}\
20140 virtual void* _abstract_method_get_forward_resize_this(size_t size)noexcept_as(instance_struct<this_t>::_abstract_method_get_forward_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_forward_resize_this(size);}\
20141 virtual size_t abstract_method_get_size_of_get_for_this()noexcept override{return instance_struct<this_t>::abstract_method_get_size_of_get_for_this();}
20142
20143 #if defined(_WIN32)
20144 #define distinctive __declspec(dllexport)
20145 #else
20146 #define distinctive
20147 #endif
20148
20149 #if defined(_WIN32)
20150 #define force_inline __forceinline
20151 #elif defined(__GNUC__)
20152 #define force_inline __attribute__((always_inline)) inline
20153 #else
20154 #define force_inline inline
20155 #endif
20156
20157 #if defined(_WIN32)
20158 #define with_no_vtable __declspec(novtable)
20159 #else
20160 #define with_no_vtable
20161 #endif
20162
20163 #define in_consteval (::std::is_constant_evaluated())
20164
20165 #define no_vtable_struct struct with_no_vtable
20166 #define no_vtable_class class with_no_vtable
20167
20168 //file_end
20169
20170 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
20171
20172 //file_end
20173
20174 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/numerical_representation/_body.hpp"
20175
20176 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/numerical_representation/defs.hpp"
20177 //defs.hpp
20178 /*
20179 未完成的elc解释器numerical_representation文件
20180 由steve02081504与Alex0125设计、编写
20181 转载时请在不对此文件做任何修改的同时注明出处
20182 项目地址:https://github.com/steve02081504/ELC
20183 */
20184
20185 /*
20186 客制化to_string用途类
20187 */
20188 struct base_numerical_representation_t{};
20189 /*
20190 记录数字的表示方式以便客制化to_string
20191 */
20192 class numerical_representation_t:public base_numerical_representation_t{
20193 size_t _radix=10;
20194 string _radix_table=es"0123456789"_constexpr_str;
20195 char_t _fractional_sign=ec('.');
20196 char_t _positive_sign=ec('+');
20197 char_t _negative_sign=ec('-');
20198 string _nan=es"NaN"_constexpr_str;
20199 string _signaling_nan=es"signaling_NaN"_constexpr_str;
20200 string _quiet_nan=es"quiet_NaN"_constexpr_str;
20201 string _inf=es"Inf"_constexpr_str;
20202 char_t _unknown_data_start_sign=ec('[');
20203 char_t _unknown_data_split_sign=ec(',');
20204 char_t _unknown_data_end_sign=ec(']');
20205 public:
20206 numerical_representation_t()noexcept=default;
20207 numerical_representation_t(const numerical_representation_t&)noexcept=default;
20208 numerical_representation_t(numerical_representation_t&&)noexcept=default;
20209 numerical_representation_t(size_t radix,string radix_table,
20210 char_t fractional_sign,
20211 char_t positive_sign,char_t negative_sign,
20212 string nan,string signaling_nan,string quiet_nan,
20213 string inf,
20214 char_t unknown_data_start_sign,char_t unknown_data_split_sign,char_t unknown_data_end_sign
20215 )noexcept:
20216 _radix(radix),_radix_table(radix_table),
20217 _fractional_sign(fractional_sign),
20218 _positive_sign(positive_sign),_negative_sign(negative_sign),
20219 _nan(nan),_signaling_nan(signaling_nan),_quiet_nan(quiet_nan),
20220 _inf(inf),
20221 _unknown_data_start_sign(unknown_data_start_sign),_unknown_data_split_sign(unknown_data_split_sign),_unknown_data_end_sign(unknown_data_end_sign)
20222 {}
20223 numerical_representation_t(size_t radix,string radix_table)noexcept:
20224 _radix(radix),
20225 _radix_table(radix_table)
20226 {}
20227 public:
20228 void set_radix(size_t radix)noexcept{
20229 _radix=radix;
20230 }
20231 void set_radix_table(string radix_table)noexcept{
20232 _radix_table=radix_table;
20233 _radix=radix_table.size();
20234 }
20235 void set_fractional_sign(char_t point)noexcept{
20236 _fractional_sign=point;
20237 }
20238 void set_positive_sign(char_t positive_sign)noexcept{
20239 _positive_sign=positive_sign;
20240 }
20241 void set_negative_sign(char_t negative_sign)noexcept{
20242 _negative_sign=negative_sign;
20243 }
20244 void set_nan(string nan)noexcept{
20245 _nan=nan;
20246 }
20247 void set_inf(string inf)noexcept{
20248 _inf=inf;
20249 }
20250 [[nodiscard]]constexpr size_t radix()const noexcept{
20251 return _radix;
20252 }
20253 [[nodiscard]]string radix_table()const noexcept{
20254 return _radix_table;
20255 }
20256 [[nodiscard]]constexpr char_t fractional_sign()const noexcept{
20257 return _fractional_sign;
20258 }
20259 [[nodiscard]]constexpr char_t positive_sign()const noexcept{
20260 return _positive_sign;
20261 }
20262 [[nodiscard]]constexpr char_t negative_sign()const noexcept{
20263 return _negative_sign;
20264 }
20265 [[nodiscard]]string nan()const noexcept{
20266 return _nan;
20267 }
20268 [[nodiscard]]string inf()const noexcept{
20269 return _inf;
20270 }
20271 private:
20272 //信息尾部分
20273 inline size_t get_info_tail_size_per_byte()const noexcept{
20274 constexpr auto info_threshold_base = pow(BIT_POSSIBILITY, bitnum_of(byte));
20275 const auto info_threshold = to_size_t(ceil(log(info_threshold_base, _radix)));
20276 return info_threshold;
20277 }
20278 template<typename T>
20279 inline size_t get_info_tail_size()const noexcept{
20280 return get_info_tail_size_per_byte()*sizeof(T);
20281 }
20282 template<typename T>
20283 inline string get_info_tail(T x)const noexcept{
20284 auto info_tail_size_per_byte = get_info_tail_size_per_byte();
20285 string aret;
20286 data_view<const T> view{&x};
20287 for(const byte c: view){
20288 auto s= to_string_rough((unsigned char)c);
20289 aret+=string{info_tail_size_per_byte-s.size(),_radix_table[0]}+s;
20290 }
20291 return aret;
20292 }
20293 template<typename T>
20294 inline T get_from_info_tail(string str)const noexcept{
20295 const auto info_tail_size_per_byte = get_info_tail_size_per_byte();
20296 T aret{};
20297 data_view<T> view{&aret};
20298 for(byte&c: view){
20299 auto s=str.substr(0,info_tail_size_per_byte);
20300 c=(byte)from_string_get<unsigned char>(s);
20301 str=str.substr(info_tail_size_per_byte);
20302 }
20303 return aret;
20304 }
20305 template<typename T>
20306 inline string to_string_num_base(T num)const noexcept{
20307 if constexpr(::std::is_floating_point_v<T>){
20308 string aret;
20309 suppress_msvc_warning(26494)//未初始化警告diss
20310 size_t order_of_magnitude;
20311 if(num>1)
20312 order_of_magnitude = to_size_t(floor(log(num,_radix)+1));
20313 else {
20314 order_of_magnitude = 0;
20315 aret=_radix_table[0];
20316 aret+=_fractional_sign;
20317 }
20318 num/=pow(_radix,order_of_magnitude);
20319 if(num>=1){
20320 aret=_radix_table[to_size_t(num)];
20321 num=0;
20322 }
20323 //Information threshold相关声明
20324 //这限制了在当前radix下mantissa的最大长度,避免如radix=3而num=0.25时的无限循环
20325 constinit auto info_threshold_base = pow(BIT_POSSIBILITY,bitnum_of(T));
20326 auto info_threshold = to_size_t(ceil(log(info_threshold_base,_radix)));
20327 //浮点数精度浮动,所以需要确定何时开始使用Info threshold
20328 bool is_mantissa_begined = false;
20329 while(num){
20330 //mantissa push部分
20331 num*=_radix;
20332 T first_char_index;
20333 num=::std::modf(num,&first_char_index);
20334 aret+=_radix_table[to_size_t(first_char_index)];
20335 //Information threshold制御部分
20336 if(to_size_t(first_char_index))
20337 is_mantissa_begined = true;
20338 if(is_mantissa_begined){
20339 if(info_threshold)
20340 info_threshold--;
20341 }
20342 //小数点计数部分
20343 if(order_of_magnitude){
20344 if(!--order_of_magnitude)
20345 aret+=_fractional_sign;
20346 }
20347 //结束判断
20348 if(!info_threshold && !order_of_magnitude)
20349 break;
20350 }
20351 if(order_of_magnitude)
20352 aret.append(order_of_magnitude,_radix_table[0]);
20353 if(aret.ends_with(_fractional_sign))
20354 aret.pop_back();
20355 return aret;
20356 }
20357 else{
20358 string aret;
20359 do{//do while,在num为0时也有返值
20360 const auto first_char_index = mod(num,_radix);
20361 num /= (T)_radix;
20362 aret.push_front(_radix_table[(size_t)first_char_index]);
20363 }while(num>=T{1});
20364 return aret;
20365 }
20366 }
20367 template<typename T>
20368 inline bool to_string_special_value_check(T num,string&str,bool is_negative)const noexcept{
20369 if constexpr(::std::numeric_limits<T>::has_signaling_NaN || ::std::numeric_limits<T>::has_quiet_NaN){
20370 if(::std::isnan(num)){
20371 if constexpr(::std::numeric_limits<T>::has_signaling_NaN){
20372 constexpr auto signaling_NaN = ::std::numeric_limits<T>::signaling_NaN();
20373 if(full_equal_in_byte(signaling_NaN,num)){
20374 str=_signaling_nan;
20375 return true;
20376 }
20377 auto negative_signaling_NaN = copy_as_negative(signaling_NaN);
20378 if(full_equal_in_byte(negative_signaling_NaN,num)){
20379 str=_negative_sign+_signaling_nan;
20380 return true;
20381 }
20382 }
20383 if constexpr(::std::numeric_limits<T>::has_quiet_NaN){
20384 constexpr auto quiet_NaN = ::std::numeric_limits<T>::quiet_NaN();
20385 if(full_equal_in_byte(quiet_NaN,num)){
20386 str=_quiet_nan;
20387 return true;
20388 }
20389 auto negative_quiet_NaN = copy_as_negative(quiet_NaN);
20390 if(full_equal_in_byte(negative_quiet_NaN,num)){
20391 str=_negative_sign+_quiet_nan;
20392 return true;
20393 }
20394 }
20395 str=_nan+_unknown_data_start_sign;
20396 data_view<T> view{&num};
20397 for(const byte c: view){
20398 str += to_string_rough((unsigned char)c);
20399 str += _unknown_data_split_sign;
20400 }
20401 str.back() = _unknown_data_end_sign;
20402 return true;
20403 }
20404 }
20405 if constexpr(::std::numeric_limits<T>::has_infinity){
20406 if(::std::isinf(num)){
20407 if constexpr(!::std::is_unsigned_v<T>)
20408 if(is_negative){
20409 str=_negative_sign+_inf;
20410 return true;
20411 }
20412 str=_inf;
20413 return true;
20414 }
20415 }
20416 return false;
20417 }
20418 template<typename T> requires ::std::is_arithmetic_v<T>
20419 inline string to_string_rough_no_special_value_check(T num)const noexcept{
20420 string aret;
20421 const bool is_negative=magic_number::is_negative(num);
20422 typedef decltype(lambda{
20423 if constexpr(::std::is_unsigned_v<T>||::std::is_floating_point_v<T>)
20424 return T();
20425 else
20426 return::std::make_unsigned_t<T>();
20427 }()) UT;
20428 //符号转无符号而不是num=-num避免INT_MAX这种情况下的溢出
20429 UT unum=UT(num);
20430 if constexpr(!::std::is_unsigned_v<T>)
20431 if(is_negative){
20432 aret=_negative_sign;
20433 unum=UT(-num);
20434 }
20435 aret+=to_string_num_base(unum);
20436 return aret;
20437 }
20438 public:
20439 template<typename T> requires ::std::is_arithmetic_v<T>
20440 inline string to_string_rough(T num)const noexcept{
20441 string aret;
20442 const bool is_negative=magic_number::is_negative(num);
20443 if(to_string_special_value_check(num,aret,is_negative))
20444 return aret;
20445 return to_string_rough_no_special_value_check(num);
20446 }
20447 private:
20448 template<typename T>
20449 inline T from_string_get_num_base(string str)const noexcept{
20450 if constexpr(::std::is_floating_point_v<T>){
20451 size_t order_of_magnitude = str.size();
20452 T aret{};
20453 size_t i=str.size();
20454 while(i){
20455 i--;
20456 const size_t index=_radix_table.find(str[i]);
20457 if(index==string::npos){
20458 if(str[i] == _fractional_sign){
20459 order_of_magnitude=i;
20460 continue;
20461 }
20462 return T();
20463 }
20464 aret+=(T)index;
20465 aret/=_radix;
20466 }
20467 aret*=pow(_radix, order_of_magnitude);
20468 return aret;
20469 }
20470 else {
20471 T aret{};
20472 for(size_t i = 0; i < str.size(); i++){
20473 const size_t index = _radix_table.find(str[i]);
20474 if(index == string::npos)
20475 return T();
20476 aret *= (T)_radix;
20477 aret += (T)index;
20478 }
20479 return aret;
20480 }
20481 }
20482 template<typename T>
20483 inline bool from_string_special_value_check(string str,T& num,bool is_negative)const noexcept{
20484 if constexpr(::std::numeric_limits<T>::has_signaling_NaN || ::std::numeric_limits<T>::has_quiet_NaN){
20485 if constexpr(::std::numeric_limits<T>::has_signaling_NaN)
20486 if(str==_signaling_nan){
20487 num= copy_as_negative(::std::numeric_limits<T>::signaling_NaN(),is_negative);
20488 return true;
20489 }
20490 if constexpr(::std::numeric_limits<T>::has_quiet_NaN)
20491 if(str==_quiet_nan){
20492 num= copy_as_negative(::std::numeric_limits<T>::quiet_NaN(),is_negative);
20493 return true;
20494 }
20495 if(str.starts_with(_nan+_unknown_data_start_sign)){
20496 str.pop_front(_nan.size()+1);
20497 str.pop_back();
20498 suppress_msvc_warning(26494)//未初始化警告diss
20499 data_block<T> block;
20500 size_t write_index = 0;
20501 floop{
20502 const size_t dot_pos = str.find(_unknown_data_split_sign);
20503 auto byte_str = str.substr(0, dot_pos);
20504 block[write_index++] = (byte)from_string_get<unsigned char>(byte_str);
20505 if(dot_pos == string::npos)
20506 break;
20507 str = str.substr(dot_pos+1);
20508 }
20509 num= data_cast<T>(block);
20510 return true;
20511 }
20512 elseif(str == _nan){
20513 if constexpr(::std::numeric_limits<T>::has_quiet_NaN)
20514 num= copy_as_negative(::std::numeric_limits<T>::quiet_NaN(),is_negative);
20515 else
20516 num= copy_as_negative(::std::numeric_limits<T>::signaling_NaN(),is_negative);
20517 return true;
20518 }
20519 }
20520 if constexpr(::std::numeric_limits<T>::has_infinity){
20521 if(str==_inf){
20522 if(is_negative)
20523 return copy_as_negative(::std::numeric_limits<T>::infinity());
20524 else
20525 return ::std::numeric_limits<T>::infinity();
20526 return true;
20527 }
20528 }
20529 return false;
20530 }
20531 public:
20532 template<typename T> requires ::std::is_arithmetic_v<T>
20533 inline T from_string_get(string str)const noexcept{
20534 //信息尾检查
20535 if constexpr(::std::is_floating_point_v<T>){
20536 const auto info_tail_size=get_info_tail_size<T>();
20537 if(str.size()>info_tail_size){
20538 const auto tail_pos=str.size()-info_tail_size;
20539 auto info_tail=str.substr(tail_pos);
20540 auto str_with_out_tail=str.substr(0,tail_pos);
20541 if(str_with_out_tail.back()==_fractional_sign)
20542 str_with_out_tail.pop_back();
20543 auto num=get_from_info_tail<T>(info_tail);
20544 if(to_string_rough(num)==str_with_out_tail)
20545 return num;
20546 str_with_out_tail+=string{info_tail.size(),_radix_table[0]};
20547 if(to_string_rough(num)==str_with_out_tail)
20548 return num;
20549 }
20550 }
20551 T num{};
20552 suppress_msvc_warning(26496);
20553 bool is_negative=false;
20554 if constexpr(!::std::is_unsigned_v<T>)
20555 if(str[0]==_negative_sign){
20556 is_negative=true;
20557 str.pop_front();
20558 }
20559 if(str[0]==_positive_sign)
20560 str.pop_front();
20561 if(from_string_special_value_check(str,num,is_negative))
20562 return num;
20563 typedef decltype(lambda{
20564 if constexpr(::std::is_unsigned_v<T>||::std::is_floating_point_v<T>)
20565 return T();
20566 else
20567 return::std::make_unsigned_t<T>();
20568 }()) UT;
20569 UT unum=from_string_get_num_base<UT>(str);
20570 return copy_as_negative<T>(unum,is_negative);
20571 }
20572 template<typename T> requires ::std::is_arithmetic_v<T>
20573 inline string to_string(T num)const noexcept{
20574 string aret;
20575 if(to_string_special_value_check(num,aret,is_negative(num)))
20576 return aret;
20577 aret=to_string_rough_no_special_value_check(num);
20578 if constexpr(::std::is_floating_point_v<T>){
20579 //进位器
20580 auto rounding_up_char = lambda_with_catch(&) (string::arec_t char_arc)noexcept{
20581 const char_t up_char = move(char_arc);
20582 size_t up_pos = _radix_table.find(up_char);
20583 up_pos++;
20584 if(up_pos == _radix)
20585 up_pos = 0;
20586 move(char_arc) = _radix_table[up_pos];
20587 return up_pos == 0;
20588 };
20589 auto rounding_up = lambda_with_catch(&) (string&str)noexcept{
20590 size_t i = str.size();
20591 while(i){
20592 if(rounding_up_char(str[i])){
20593 if(i--){
20594 if(str[i] == _fractional_sign)
20595 i--;
20596 }
20597 else
20598 str.push_front(_radix_table[1]);
20599 continue;
20600 }
20601 else
20602 break;
20603 }
20604 };
20605 size_t dot_pos=aret.find(_fractional_sign);
20606 //检查是否可反向转换
20607 if(from_string_get<T>(aret) != num){
20608 //获取并追加信息尾
20609 string info_tail=get_info_tail(num);
20610 if(dot_pos==string::npos){
20611 if(aret.ends_with(string{info_tail.size(),_radix_table[0]}))
20612 aret.pop_back(info_tail.size());
20613 else
20614 aret.push_back(_fractional_sign);
20615 }
20616 aret+=info_tail;
20617 return aret;
20618 }
20619 {
20620 //二分法查找最合适的切割位点.
20621 size_t left_pos = 0;
20622 size_t right_pos = aret.size();
20623 string better_aret,better_aret_last;
20624 if(dot_pos==string::npos)
20625 dot_pos=aret.size();
20626 do {
20627 size_t step_pos = (left_pos + right_pos) / 2;
20628 better_aret = aret.substr(0, step_pos);
20629 if(step_pos==dot_pos)
20630 step_pos++;
20631 //判断是否需要进位.(当被截断内容在radix_table的后半部分.)
20632 const char_t cut_char = aret[step_pos];
20633 const size_t cut_num = _radix_table.find(cut_char);
20634 if(cut_num >= _radix / 2)
20635 rounding_up(better_aret);
20636 if(better_aret.size() < dot_pos)//0补全
20637 better_aret.resize(dot_pos,_radix_table[0]);
20638 //判断当前切割位点有效性.
20639 if(from_string_get<T>(better_aret) == num){
20640 if(better_aret.back() == _radix_table[0]){
20641 const auto end_pos = max(better_aret.find_last_not_of(_radix_table[0])+1, dot_pos);
20642 better_aret.resize(end_pos);
20643 if(better_aret.back() == _fractional_sign)
20644 better_aret.pop_back();
20645 }
20646 right_pos = min(better_aret.size(), step_pos);
20647 better_aret_last = better_aret;
20648 }
20649 elseif(left_pos != step_pos)
20650 left_pos = step_pos;
20651 else
20652 left_pos++;
20653 } while(left_pos < right_pos);
20654 if(better_aret_last){
20655 aret = better_aret_last;
20656 if(aret.ends_with(_fractional_sign))
20657 aret.pop_back();
20658 }
20659 }
20660 }
20661 return aret;
20662 }
20663 };
20665 distinctive inline numerical_representation_t trinary{3,es"012"_constexpr_str};
20666 distinctive inline numerical_representation_t binary{2,es"01"_constexpr_str};
20667 distinctive inline numerical_representation_t octal{8,es"01234567"_constexpr_str};
20668 distinctive inline numerical_representation_t decimal{10,es"0123456789"_constexpr_str};
20669 distinctive inline numerical_representation_t hexadecimal{16,es"0123456789abcdef"_constexpr_str};
20670 distinctive inline numerical_representation_t hexadecimal_upper{16,es"0123456789ABCDEF"_constexpr_str};
20672
20673 //字符串转换为数值
20674 template<typename T> requires ::std::is_arithmetic_v<T>
20675 inline T from_string_get(const string&str,const numerical_representation_t&radix=decimal)noexcept{
20676 return radix.from_string_get<T>(str);
20677 }
20678 //数值转换为字符串(小数部分粗略处理)
20679 template<typename T> requires ::std::is_arithmetic_v<T>
20680 inline string to_string_rough(T num,const numerical_representation_t&radix=decimal)noexcept{
20681 return radix.to_string_rough(num);
20682 }
20683 //数值转换为字符串
20684 template<typename T> requires ::std::is_arithmetic_v<T>
20685 inline string to_string(T num,const numerical_representation_t&radix=decimal)noexcept{
20686 return radix.to_string(num);
20687 }
20688
20689 //file_end
20690
20691 #line 15 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/numerical_representation/_body.hpp"
20692 #if defined(ELC_TEST_ON)
20693 namespace numerical_representation_part_test{
20694 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/numerical_representation/_test.hpp"
20695 //_test.hpp
20696 /*
20697 未完成的elc解释器numerical_representation文件
20698 由steve02081504与Alex0125设计、编写
20699 转载时请在不对此文件做任何修改的同时注明出处
20700 项目地址:https://github.com/steve02081504/ELC
20701 */
20702 inline void test(){
20703 ELC_TEST_EVENTNAME("numerical_representation部分测试");
20704 }
20705 inline void test_log_out(){
20706 }
20707 inline void test_end(){
20708 }
20709
20710 //file_end
20711
20712 #line 18 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/numerical_representation/_body.hpp"
20713 }
20714 #endif
20715
20716 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
20717 //_undefs.hpp
20718 /*
20719 未完成的elc解释器basic文件
20720 由steve02081504与Alex0125设计、编写
20721 转载时请在不对此文件做任何修改的同时注明出处
20722 项目地址:https://github.com/steve02081504/ELC
20723 */
20724 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_undefs.hpp"
20725 //_undefs.hpp
20726 /*
20727 未完成的elc解释器_share文件
20728 由steve02081504与Alex0125设计、编写
20729 转载时请在不对此文件做任何修改的同时注明出处
20730 项目地址:https://github.com/steve02081504/ELC
20731 */
20732
20733 //defs at "_defs.hpp"
20734
20735 #if defined(_MSC_VER)
20736 #pragma warning(pop)
20737 #endif
20738 #undef suppress_msvc_warning
20739 #undef disable_msvc_warning
20740 #undef push_msvc_warning
20741 #undef pop_msvc_warning
20742 #undef push_and_disable_msvc_warning
20743
20744 //for basic_environment.hpp
20745 #undef BIT_POSSIBILITY
20746 //
20747 #if defined(ELC_VOID_NAME)
20748 #define void the_void
20749 #endif
20750
20751 // #undef often_noexcept
20752 #undef noexcept_as
20753 #undef noexcept_as_auto
20754 #undef constexpr_as
20755 #undef constexpr_as_auto
20756
20757 #undef using_method_from_base_t
20758 #undef using_method_from_value
20759
20760 #undef floop
20761 #undef enable_adl
20762
20763 #undef re_declvalue
20764 #undef re_decltype
20765
20766 #undef declvalue
20767
20768 #undef template_error
20769 #undef template_warning
20770
20771 #undef type_info_of
20772 #undef type_name_of
20773
20774 #undef is_common_attribute
20775 #undef is_special_attribute
20776
20777 #undef has_attribute
20778 #undef not_has_attribute
20779
20780 #undef float_size_of
20781 #undef bitnum_of
20782
20783 #undef def_common_attribute_with_nothing
20784 #undef def_special_attribute_with_nothing
20785
20786 #undef common_attribute_t
20787 #undef special_attribute_t
20788
20789 #undef enable_if
20790 #undef enabled_by_default
20791 #undef disabled_by_default
20792 #undef enable_if_not_ill_form
20793 #undef enable_flag
20794
20795 #undef was_an_ill_form
20796 #undef was_an_ill_form_with_parameter
20797 #undef was_not_an_ill_form
20798 #undef was_not_an_ill_form_and_noexcept
20799 #undef was_not_an_ill_form_with_parameter
20800
20801 #undef recursive_lambda
20802 #undef get_recursive_lambda_caller
20803 #undef lambda
20804 #undef lambda_with_catch
20805 #undef self_recursion
20806 #undef lambda_RLSRRS
20807
20808 #undef MAGIC
20809
20810 #undef nothing
20811
20812 #undef elseif
20813 #undef _big_than_
20814 #undef _small_than_
20815
20816 #if defined(_MSC_VER)
20817 #undef not
20818 #undef and
20819 #undef or
20820 #endif
20821
20822 #undef INTER_NAMESPACE
20823 #undef BREAK_NAMESPACE
20824
20825 #undef szie
20826 #undef form
20827
20828 #undef template_name
20829 #undef type_name
20830
20831 #undef not_in_debug
20832
20833 #undef es
20834 #undef ec
20835
20836 #undef ELC_TEST_EVENTNAME
20837
20838 #undef override_instance_struct
20839
20840 #undef distinctive
20841
20842 #undef force_inline
20843
20844 #undef with_no_vtable
20845
20846 #undef in_consteval
20847
20848 #undef no_vtable_struct
20849 #undef no_vtable_class
20850
20851 //file_end
20852
20853 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
20854
20855 //file_end
20856
20857 #line 22 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/numerical_representation/_body.hpp"
20858 }
20859 namespace elc{
20860 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/numerical_representation/_export.hpp"
20861 //_export.hpp
20862 //at namespace elc
20863 /*
20864 未完成的elc解释器numerical_representation文件
20865 由steve02081504与Alex0125设计、编写
20866 转载时请在不对此文件做任何修改的同时注明出处
20867 项目地址:https://github.com/steve02081504/ELC
20868 */
20869 #define export using defs::
20870 export to_string;
20871 export to_string_rough;
20872 export from_string_get;
20873 #undef export
20874
20875 //file_end
20876
20877 #line 25 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/numerical_representation/_body.hpp"
20878 }
20879
20880 //file_end
20881
20882 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/numerical_representation"
20883 #endif
20884
20885 //file_end
20886
20887 #line 24 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/library_load.hpp"
20888 #else
20889 #error ERROR_MSG_UNABLE_OS
20890 #endif
20892 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
20893 //_defs.hpp
20894 /*
20895 未完成的elc解释器_share文件
20896 由steve02081504与Alex0125设计、编写
20897 转载时请在不对此文件做任何修改的同时注明出处
20898 项目地址:https://github.com/steve02081504/ELC
20899 */
20900
20901 //undefs at "_undefs.hpp"
20902
20903 //set ELC_WARNING_LEVEL default to 4(max)
20904 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
20905
20906 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/basic_environment.hpp"
20907 //basic_environment.hpp
20908 /*
20909 未完成的elc解释器_share文件
20910 由steve02081504与Alex0125设计、编写
20911 转载时请在不对此文件做任何修改的同时注明出处
20912 项目地址:https://github.com/steve02081504/ELC
20913 */
20914
20917 #define BIT_POSSIBILITY 2
20918
20919 //file_end
20920
20921 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
20922
20923 #if defined(_MSC_VER)
20924 #pragma warning(push,ELC_WARNING_LEVEL)
20925 #pragma warning(disable:4099)//class与struct混用警告diss
20926 #pragma warning(disable:26812)//enum class安利diss.
20927 #pragma warning(disable:4584)//重复子类警告diss
20928 #pragma warning(disable:4250)//域控制继承警告diss
20929 #pragma warning(disable:26432)//不完全默认方法警告diss
20930 #pragma warning(disable:26435)//virtual override方法警告diss
20931 #pragma warning(disable:26481)//容器安利diss
20932 #pragma warning(disable:26446)//gsl::at安利diss
20933 #pragma warning(disable:26434)//方法覆盖警告diss
20934 #pragma warning(disable:26429)//gsl::not_null安利diss
20935 #pragma warning(disable:26471)//对void*进行static_cast安利diss
20936 #pragma warning(disable:26474)//隐式指针转换显式cast警告diss
20937 #pragma warning(disable:26473)//相同指针显式cast警告diss
20938 #pragma warning(disable:26456)//隐藏非虚运算符警告diss
20939 #pragma warning(disable:26485)//数组作指针警告diss
20940 #pragma warning(disable:26490)//reinterpret_cast警告diss
20941 #pragma warning(disable:26472)//static_cast窄幅转换警告diss
20942 #pragma warning(disable:26482)//非常数数组索引警告diss
20943 #pragma warning(disable:26493)//c_cast转换警告diss:虽然有用但是太烦了,爬
20944 #endif
20945 #if defined(_MSC_VER)
20946 #define suppress_msvc_warning(...) __pragma(warning(suppress:__VA_ARGS__))
20947 #define disable_msvc_warning(...) __pragma(warning(disable:__VA_ARGS__))
20948 #define push_msvc_warning() __pragma(warning(push))
20949 #define pop_msvc_warning() __pragma(warning(pop))
20950 #define push_and_disable_msvc_warning(...) push_msvc_warning() disable_msvc_warning(__VA_ARGS__)
20951 #else
20952 #define suppress_msvc_warning(...)
20953 #define disable_msvc_warning(...)
20954 #define push_msvc_warning()
20955 #define pop_msvc_warning()
20956 #define push_and_disable_msvc_warning(...)
20957 #endif
20958 //
20959 #if defined(ELC_VOID_NAME)
20960 #undef void
20961 #endif
20962
20963 // #define often_noexcept
20964 #define noexcept_as(...) noexcept(noexcept((__VA_ARGS__)))//dnmd C艹标准就是没有noexcept_as_auto
20965 #define noexcept_as_auto MAGIC//哦现在有了
20966 #define constexpr_as(...) MAGIC constexpr//( •̀ ω •́ )✌
20967 #define constexpr_as_auto MAGIC MAGIC constexpr//✌( •̀ ω •́ )✌
20968
20969 #define using_method_from_base_t(name,...) \
20970 template<class...Args> requires was_not_an_ill_form(declvalue(base_t).name(declvalue(Args)...))\
20971 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(base_t::name(declvalue(Args)...))\
20972 {\
20973 return base_t::name(forward<Args>(rest)...);\
20974 }\
20975
20976 #define using_method_from_value(name,value_name,...) \
20977 template<class...Args> requires was_not_an_ill_form(re_declvalue(value_name).name(declvalue(Args)...))\
20978 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(re_declvalue(value_name).name(declvalue(Args)...))\
20979 {\
20980 return value_name.name(forward<Args>(rest)...);\
20981 }\
20982
20983 #define floop while(__builtin_is_my_dick_still_there())
20984 #define enable_adl(name) void name()noexcept=delete
20985
20986 #define re_declvalue(...) (declvalue(decltype(__VA_ARGS__)))
20987 #define re_decltype(...) (decltype(declvalue(__VA_ARGS__)))
20988
20989 #define declvalue(...) (::std::declval<__VA_ARGS__>())
20990
20992 #define template_error(reason) static_assert(template_error_helper<T>,reason)
20994 #define template_warning(reason) template_warning_helper<T>(reason)
20995
20996 //for type_info
20997 #define type_info_of(...) base_type_info_t(typeid(__VA_ARGS__))
20998 #define type_name_of(...) (type_info_of(__VA_ARGS__).name())
20999
21000 #define is_common_attribute(name) public attribute<T,name<T>>
21001 #define is_special_attribute(name) public attribute<T,name>
21002
21003 #define has_attribute(...) template_name has_attribute_helper<__VA_ARGS__>()
21004 #define not_has_attribute(...) template_name not_has_has_attribute_helper<__VA_ARGS__>()
21005
21006 //for float_size_t
21007 #define float_size_of(...) (float_size_t{sizeof(__VA_ARGS__)})
21008 //bitnum_of
21009 #define bitnum_of(...) (bitnumof<__VA_ARGS__>)
21010
21011 //for attribute
21012 #define def_common_attribute_with_nothing(name) \
21013 template<typename T>\
21014 class name{}\
21015
21016 #define def_special_attribute_with_nothing(name) \
21017 class name{}\
21018
21019 #define common_attribute_t template<class>class
21020 #define special_attribute_t class
21021
21030 #define enable_if(...) class enable_state= ::std::enable_if_t<__VA_ARGS__>
21032 #define enabled_by_default class enable_state=void
21034 #define disabled_by_default class enable_state= ::std::enable_if_t<false>
21036 #define enable_if_not_ill_form(...) class enable_state= ::std::void_t<decltype(__VA_ARGS__)>
21038 #define enable_flag class enable_state
21039
21040 #define was_an_ill_form(...) (!was_not_an_ill_form(__VA_ARGS__))
21041 #define was_an_ill_form_with_parameter(...) (!was_not_an_ill_form_with_parameter(__VA_ARGS__))
21042 #define was_not_an_ill_form(...) (bool(requires{__VA_ARGS__;}))
21043 #define was_not_an_ill_form_and_noexcept(...) (bool(requires{__VA_ARGS__;{__VA_ARGS__}noexcept;}))
21044 #define was_not_an_ill_form_with_parameter(...) (bool(requires __VA_ARGS__ ))
21045
21047 #define recursive_lambda(...) lambda(auto&&lambda_RLSRRS,__VA_ARGS__)
21049 #define get_recursive_lambda_caller(name) \
21050 lambda_with_catch(&)(auto&&...Args){\
21051 return name(name,Args...);\
21052 }
21054 #define lambda []
21056 #define lambda_with_catch(...) [__VA_ARGS__]
21058 #define self_recursion(...) lambda_RLSRRS(lambda_RLSRRS,__VA_ARGS__)
21059 //recursive_lambda_self_referential_reserved_symbolname
21060 #define lambda_RLSRRS _my_jb_super_sb_name_
21061
21062 #define MAGIC//ahh,ko no tenno da!
21063
21065 #define nothing
21066
21068 #define elseif else if
21070 #define _big_than_ >
21072 #define _small_than_ <
21073
21074 #if defined(_MSC_VER)
21075 #define not !
21076 #define and &&
21077 #define or ||
21078 #endif
21079
21081 #define INTER_NAMESPACE(NAMESPACENAME) namespace NAMESPACENAME{
21083 #define BREAK_NAMESPACE }
21084
21086 #define template_name template
21088 #define type_name class
21089
21090 #if defined(DEBUG) || defined(_DEBUG)
21091 #define not_in_debug 0
21092 #else
21093 #define not_in_debug 1
21094 #endif
21095
21096 #define es U""
21097 #define ec(ch) U ## ch
21098
21099 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
21100 #define ELC_TEST_EVENTNAME(name) stest_eventer _the_stest_eventer__(L""name)
21101 #else
21102 #define ELC_TEST_EVENTNAME(name)
21103 #endif
21104
21105 #define override_instance_struct \
21106 protected:\
21107 virtual void abstract_method_unget_this()noexcept_as(instance_struct<this_t>::abstract_method_unget_this())override{instance_struct<this_t>::abstract_method_unget_this();}\
21108 virtual void* _abstract_method_copy_get_this()noexcept_as(instance_struct<this_t>::_abstract_method_copy_get_this())override{return instance_struct<this_t>::_abstract_method_copy_get_this();}\
21109 virtual void* _abstract_method_get_resize_this(size_t size)noexcept_as(instance_struct<this_t>::instance_struct<this_t>::_abstract_method_get_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_resize_this(size);}\
21110 virtual void* _abstract_method_get_forward_resize_this(size_t size)noexcept_as(instance_struct<this_t>::_abstract_method_get_forward_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_forward_resize_this(size);}\
21111 virtual size_t abstract_method_get_size_of_get_for_this()noexcept override{return instance_struct<this_t>::abstract_method_get_size_of_get_for_this();}
21112
21113 #if defined(_WIN32)
21114 #define distinctive __declspec(dllexport)
21115 #else
21116 #define distinctive
21117 #endif
21118
21119 #if defined(_WIN32)
21120 #define force_inline __forceinline
21121 #elif defined(__GNUC__)
21122 #define force_inline __attribute__((always_inline)) inline
21123 #else
21124 #define force_inline inline
21125 #endif
21126
21127 #if defined(_WIN32)
21128 #define with_no_vtable __declspec(novtable)
21129 #else
21130 #define with_no_vtable
21131 #endif
21132
21133 #define in_consteval (::std::is_constant_evaluated())
21134
21135 #define no_vtable_struct struct with_no_vtable
21136 #define no_vtable_class class with_no_vtable
21137
21138 //file_end
21139
21140 #line 29 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/library_load.hpp"
21141
21142 using namespace ::elc::defs;
21143
21144 typedef
21145 #if SYSTEM_TYPE == linux
21146 void*
21147 #elif SYSTEM_TYPE == windows
21148 HMODULE
21149 #endif
21151
21152 [[nodiscard]]inline library_handle base_load_library(const char*file_name)noexcept{
21153 //可返回bool意义为空的值表示失败
21154 return
21155 #if SYSTEM_TYPE == linux
21156 dlopen(file_name,RTLD_LAZY)
21157 #elif SYSTEM_TYPE == windows
21158 LoadLibraryA((LPCSTR)file_name)
21159 #endif
21160 ;
21161 }
21162 [[nodiscard]]inline string base_get_load_error()noexcept{
21163 return
21164 #if SYSTEM_TYPE == linux
21165 to_char_t_str(dlerror());
21166 #elif SYSTEM_TYPE == windows
21167 es"ERROR CODE:"_constexpr_str+to_string((DWORD)GetLastError());//傻逼微软设计的jb端口,再您妈的见
21168 #endif
21169 ;
21170 }
21171 inline void base_free_library(library_handle handle)noexcept{
21172 #if SYSTEM_TYPE == linux
21173 dlclose(handle)
21174 #elif SYSTEM_TYPE == windows
21175 FreeLibrary(handle)
21176 #endif
21177 ;
21178 }
21179 [[nodiscard]]inline void* base_get_symbol(library_handle handle,const char*symbol_name)noexcept{
21180 //可返回bool意义为空的值表示失败
21181 return
21182 #if SYSTEM_TYPE == linux
21183 dlsym(handle,symbol_name)
21184 #elif SYSTEM_TYPE == windows
21185 (void*)GetProcAddress(handle,(LPCSTR)symbol_name)
21186 #endif
21187 ;
21188 }
21189
21190 [[nodiscard]]inline library_handle load_library(string file_name)noexcept{
21191 //可返回bool意义为空的值表示失败
21192 return base_load_library(to_char_str(file_name).c_str());
21193 }
21194 [[nodiscard]]inline string get_load_error()noexcept{
21195 return base_get_load_error();
21196 }
21197 inline void free_library(library_handle handle)noexcept{
21198 return base_free_library(handle);
21199 }
21200 [[nodiscard]]inline void* get_symbol(library_handle handle,string symbol_name)noexcept{
21201 //可返回bool意义为空的值表示失败
21202 return base_get_symbol(handle,to_char_str(symbol_name).c_str());
21203 }
21204
21205 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_undefs.hpp"
21206 //_undefs.hpp
21207 /*
21208 未完成的elc解释器_share文件
21209 由steve02081504与Alex0125设计、编写
21210 转载时请在不对此文件做任何修改的同时注明出处
21211 项目地址:https://github.com/steve02081504/ELC
21212 */
21213
21214 //defs at "_defs.hpp"
21215
21216 #if defined(_MSC_VER)
21217 #pragma warning(pop)
21218 #endif
21219 #undef suppress_msvc_warning
21220 #undef disable_msvc_warning
21221 #undef push_msvc_warning
21222 #undef pop_msvc_warning
21223 #undef push_and_disable_msvc_warning
21224
21225 //for basic_environment.hpp
21226 #undef BIT_POSSIBILITY
21227 //
21228 #if defined(ELC_VOID_NAME)
21229 #define void the_void
21230 #endif
21231
21232 // #undef often_noexcept
21233 #undef noexcept_as
21234 #undef noexcept_as_auto
21235 #undef constexpr_as
21236 #undef constexpr_as_auto
21237
21238 #undef using_method_from_base_t
21239 #undef using_method_from_value
21240
21241 #undef floop
21242 #undef enable_adl
21243
21244 #undef re_declvalue
21245 #undef re_decltype
21246
21247 #undef declvalue
21248
21249 #undef template_error
21250 #undef template_warning
21251
21252 #undef type_info_of
21253 #undef type_name_of
21254
21255 #undef is_common_attribute
21256 #undef is_special_attribute
21257
21258 #undef has_attribute
21259 #undef not_has_attribute
21260
21261 #undef float_size_of
21262 #undef bitnum_of
21263
21264 #undef def_common_attribute_with_nothing
21265 #undef def_special_attribute_with_nothing
21266
21267 #undef common_attribute_t
21268 #undef special_attribute_t
21269
21270 #undef enable_if
21271 #undef enabled_by_default
21272 #undef disabled_by_default
21273 #undef enable_if_not_ill_form
21274 #undef enable_flag
21275
21276 #undef was_an_ill_form
21277 #undef was_an_ill_form_with_parameter
21278 #undef was_not_an_ill_form
21279 #undef was_not_an_ill_form_and_noexcept
21280 #undef was_not_an_ill_form_with_parameter
21281
21282 #undef recursive_lambda
21283 #undef get_recursive_lambda_caller
21284 #undef lambda
21285 #undef lambda_with_catch
21286 #undef self_recursion
21287 #undef lambda_RLSRRS
21288
21289 #undef MAGIC
21290
21291 #undef nothing
21292
21293 #undef elseif
21294 #undef _big_than_
21295 #undef _small_than_
21296
21297 #if defined(_MSC_VER)
21298 #undef not
21299 #undef and
21300 #undef or
21301 #endif
21302
21303 #undef INTER_NAMESPACE
21304 #undef BREAK_NAMESPACE
21305
21306 #undef szie
21307 #undef form
21308
21309 #undef template_name
21310 #undef type_name
21311
21312 #undef not_in_debug
21313
21314 #undef es
21315 #undef ec
21316
21317 #undef ELC_TEST_EVENTNAME
21318
21319 #undef override_instance_struct
21320
21321 #undef distinctive
21322
21323 #undef force_inline
21324
21325 #undef with_no_vtable
21326
21327 #undef in_consteval
21328
21329 #undef no_vtable_struct
21330 #undef no_vtable_class
21331
21332 //file_end
21333
21334 #line 94 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/library_load.hpp"
21335 }
21336 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/_tools/undef_decl_system_type.hpp"
21337 //undef_decl_system_type.hpp
21338 /*
21339 未完成的elc解释器_share文件
21340 由steve02081504与Alex0125设计、编写
21341 转载时请在不对此文件做任何修改的同时注明出处
21342 项目地址:https://github.com/steve02081504/ELC
21343 */
21344 //copy&rewrite from steve02081504/evest.h
21345 #undef linux
21346 #undef windows
21347 #undef other
21348 #undef SYSTEM_TYPE
21349 #undef ERROR_MSG_UNABLE_OS
21350
21351 //file_end
21352
21353 #line 96 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/library_load.hpp"
21354 #endif
21355
21356 //file_end
21357
21358 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/lib_loader/_body.hpp"
21359 //include locale:自然语言相关的字符串
21360 //strings
21361 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/locale/using.hpp"
21362 //using.hpp
21363 /*
21364 未完成的elc解释器_share文件
21365 由steve02081504与Alex0125设计、编写
21366 转载时请在不对此文件做任何修改的同时注明出处
21367 项目地址:https://github.com/steve02081504/ELC
21368 */
21369 /*
21370 locale说明
21371 elc使用的字符串.
21372 调整这些,实现快速本地化.
21373 */
21374 #line 26 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/locale/using.hpp"
21375
21376 //file_end
21377
21378 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/lib_loader/_body.hpp"
21379 namespace elc::defs{
21380 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
21381 //_defs.hpp
21382 /*
21383 未完成的elc解释器basic文件
21384 由steve02081504与Alex0125设计、编写
21385 转载时请在不对此文件做任何修改的同时注明出处
21386 项目地址:https://github.com/steve02081504/ELC
21387 */
21388 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
21389 //_defs.hpp
21390 /*
21391 未完成的elc解释器_share文件
21392 由steve02081504与Alex0125设计、编写
21393 转载时请在不对此文件做任何修改的同时注明出处
21394 项目地址:https://github.com/steve02081504/ELC
21395 */
21396
21397 //undefs at "_undefs.hpp"
21398
21399 //set ELC_WARNING_LEVEL default to 4(max)
21400 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
21401
21402 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/basic_environment.hpp"
21403 //basic_environment.hpp
21404 /*
21405 未完成的elc解释器_share文件
21406 由steve02081504与Alex0125设计、编写
21407 转载时请在不对此文件做任何修改的同时注明出处
21408 项目地址:https://github.com/steve02081504/ELC
21409 */
21410
21413 #define BIT_POSSIBILITY 2
21414
21415 //file_end
21416
21417 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
21418
21419 #if defined(_MSC_VER)
21420 #pragma warning(push,ELC_WARNING_LEVEL)
21421 #pragma warning(disable:4099)//class与struct混用警告diss
21422 #pragma warning(disable:26812)//enum class安利diss.
21423 #pragma warning(disable:4584)//重复子类警告diss
21424 #pragma warning(disable:4250)//域控制继承警告diss
21425 #pragma warning(disable:26432)//不完全默认方法警告diss
21426 #pragma warning(disable:26435)//virtual override方法警告diss
21427 #pragma warning(disable:26481)//容器安利diss
21428 #pragma warning(disable:26446)//gsl::at安利diss
21429 #pragma warning(disable:26434)//方法覆盖警告diss
21430 #pragma warning(disable:26429)//gsl::not_null安利diss
21431 #pragma warning(disable:26471)//对void*进行static_cast安利diss
21432 #pragma warning(disable:26474)//隐式指针转换显式cast警告diss
21433 #pragma warning(disable:26473)//相同指针显式cast警告diss
21434 #pragma warning(disable:26456)//隐藏非虚运算符警告diss
21435 #pragma warning(disable:26485)//数组作指针警告diss
21436 #pragma warning(disable:26490)//reinterpret_cast警告diss
21437 #pragma warning(disable:26472)//static_cast窄幅转换警告diss
21438 #pragma warning(disable:26482)//非常数数组索引警告diss
21439 #pragma warning(disable:26493)//c_cast转换警告diss:虽然有用但是太烦了,爬
21440 #endif
21441 #if defined(_MSC_VER)
21442 #define suppress_msvc_warning(...) __pragma(warning(suppress:__VA_ARGS__))
21443 #define disable_msvc_warning(...) __pragma(warning(disable:__VA_ARGS__))
21444 #define push_msvc_warning() __pragma(warning(push))
21445 #define pop_msvc_warning() __pragma(warning(pop))
21446 #define push_and_disable_msvc_warning(...) push_msvc_warning() disable_msvc_warning(__VA_ARGS__)
21447 #else
21448 #define suppress_msvc_warning(...)
21449 #define disable_msvc_warning(...)
21450 #define push_msvc_warning()
21451 #define pop_msvc_warning()
21452 #define push_and_disable_msvc_warning(...)
21453 #endif
21454 //
21455 #if defined(ELC_VOID_NAME)
21456 #undef void
21457 #endif
21458
21459 // #define often_noexcept
21460 #define noexcept_as(...) noexcept(noexcept((__VA_ARGS__)))//dnmd C艹标准就是没有noexcept_as_auto
21461 #define noexcept_as_auto MAGIC//哦现在有了
21462 #define constexpr_as(...) MAGIC constexpr//( •̀ ω •́ )✌
21463 #define constexpr_as_auto MAGIC MAGIC constexpr//✌( •̀ ω •́ )✌
21464
21465 #define using_method_from_base_t(name,...) \
21466 template<class...Args> requires was_not_an_ill_form(declvalue(base_t).name(declvalue(Args)...))\
21467 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(base_t::name(declvalue(Args)...))\
21468 {\
21469 return base_t::name(forward<Args>(rest)...);\
21470 }\
21471
21472 #define using_method_from_value(name,value_name,...) \
21473 template<class...Args> requires was_not_an_ill_form(re_declvalue(value_name).name(declvalue(Args)...))\
21474 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(re_declvalue(value_name).name(declvalue(Args)...))\
21475 {\
21476 return value_name.name(forward<Args>(rest)...);\
21477 }\
21478
21479 #define floop while(__builtin_is_my_dick_still_there())
21480 #define enable_adl(name) void name()noexcept=delete
21481
21482 #define re_declvalue(...) (declvalue(decltype(__VA_ARGS__)))
21483 #define re_decltype(...) (decltype(declvalue(__VA_ARGS__)))
21484
21485 #define declvalue(...) (::std::declval<__VA_ARGS__>())
21486
21488 #define template_error(reason) static_assert(template_error_helper<T>,reason)
21490 #define template_warning(reason) template_warning_helper<T>(reason)
21491
21492 //for type_info
21493 #define type_info_of(...) base_type_info_t(typeid(__VA_ARGS__))
21494 #define type_name_of(...) (type_info_of(__VA_ARGS__).name())
21495
21496 #define is_common_attribute(name) public attribute<T,name<T>>
21497 #define is_special_attribute(name) public attribute<T,name>
21498
21499 #define has_attribute(...) template_name has_attribute_helper<__VA_ARGS__>()
21500 #define not_has_attribute(...) template_name not_has_has_attribute_helper<__VA_ARGS__>()
21501
21502 //for float_size_t
21503 #define float_size_of(...) (float_size_t{sizeof(__VA_ARGS__)})
21504 //bitnum_of
21505 #define bitnum_of(...) (bitnumof<__VA_ARGS__>)
21506
21507 //for attribute
21508 #define def_common_attribute_with_nothing(name) \
21509 template<typename T>\
21510 class name{}\
21511
21512 #define def_special_attribute_with_nothing(name) \
21513 class name{}\
21514
21515 #define common_attribute_t template<class>class
21516 #define special_attribute_t class
21517
21526 #define enable_if(...) class enable_state= ::std::enable_if_t<__VA_ARGS__>
21528 #define enabled_by_default class enable_state=void
21530 #define disabled_by_default class enable_state= ::std::enable_if_t<false>
21532 #define enable_if_not_ill_form(...) class enable_state= ::std::void_t<decltype(__VA_ARGS__)>
21534 #define enable_flag class enable_state
21535
21536 #define was_an_ill_form(...) (!was_not_an_ill_form(__VA_ARGS__))
21537 #define was_an_ill_form_with_parameter(...) (!was_not_an_ill_form_with_parameter(__VA_ARGS__))
21538 #define was_not_an_ill_form(...) (bool(requires{__VA_ARGS__;}))
21539 #define was_not_an_ill_form_and_noexcept(...) (bool(requires{__VA_ARGS__;{__VA_ARGS__}noexcept;}))
21540 #define was_not_an_ill_form_with_parameter(...) (bool(requires __VA_ARGS__ ))
21541
21543 #define recursive_lambda(...) lambda(auto&&lambda_RLSRRS,__VA_ARGS__)
21545 #define get_recursive_lambda_caller(name) \
21546 lambda_with_catch(&)(auto&&...Args){\
21547 return name(name,Args...);\
21548 }
21550 #define lambda []
21552 #define lambda_with_catch(...) [__VA_ARGS__]
21554 #define self_recursion(...) lambda_RLSRRS(lambda_RLSRRS,__VA_ARGS__)
21555 //recursive_lambda_self_referential_reserved_symbolname
21556 #define lambda_RLSRRS _my_jb_super_sb_name_
21557
21558 #define MAGIC//ahh,ko no tenno da!
21559
21561 #define nothing
21562
21564 #define elseif else if
21566 #define _big_than_ >
21568 #define _small_than_ <
21569
21570 #if defined(_MSC_VER)
21571 #define not !
21572 #define and &&
21573 #define or ||
21574 #endif
21575
21577 #define INTER_NAMESPACE(NAMESPACENAME) namespace NAMESPACENAME{
21579 #define BREAK_NAMESPACE }
21580
21582 #define template_name template
21584 #define type_name class
21585
21586 #if defined(DEBUG) || defined(_DEBUG)
21587 #define not_in_debug 0
21588 #else
21589 #define not_in_debug 1
21590 #endif
21591
21592 #define es U""
21593 #define ec(ch) U ## ch
21594
21595 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
21596 #define ELC_TEST_EVENTNAME(name) stest_eventer _the_stest_eventer__(L""name)
21597 #else
21598 #define ELC_TEST_EVENTNAME(name)
21599 #endif
21600
21601 #define override_instance_struct \
21602 protected:\
21603 virtual void abstract_method_unget_this()noexcept_as(instance_struct<this_t>::abstract_method_unget_this())override{instance_struct<this_t>::abstract_method_unget_this();}\
21604 virtual void* _abstract_method_copy_get_this()noexcept_as(instance_struct<this_t>::_abstract_method_copy_get_this())override{return instance_struct<this_t>::_abstract_method_copy_get_this();}\
21605 virtual void* _abstract_method_get_resize_this(size_t size)noexcept_as(instance_struct<this_t>::instance_struct<this_t>::_abstract_method_get_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_resize_this(size);}\
21606 virtual void* _abstract_method_get_forward_resize_this(size_t size)noexcept_as(instance_struct<this_t>::_abstract_method_get_forward_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_forward_resize_this(size);}\
21607 virtual size_t abstract_method_get_size_of_get_for_this()noexcept override{return instance_struct<this_t>::abstract_method_get_size_of_get_for_this();}
21608
21609 #if defined(_WIN32)
21610 #define distinctive __declspec(dllexport)
21611 #else
21612 #define distinctive
21613 #endif
21614
21615 #if defined(_WIN32)
21616 #define force_inline __forceinline
21617 #elif defined(__GNUC__)
21618 #define force_inline __attribute__((always_inline)) inline
21619 #else
21620 #define force_inline inline
21621 #endif
21622
21623 #if defined(_WIN32)
21624 #define with_no_vtable __declspec(novtable)
21625 #else
21626 #define with_no_vtable
21627 #endif
21628
21629 #define in_consteval (::std::is_constant_evaluated())
21630
21631 #define no_vtable_struct struct with_no_vtable
21632 #define no_vtable_class class with_no_vtable
21633
21634 //file_end
21635
21636 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
21637
21638 //file_end
21639
21640 #line 18 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/lib_loader/_body.hpp"
21641
21642 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/lib_loader/lib_loader.hpp"
21643 //lib_loader.hpp
21644 //at namespace elc
21645 /*
21646 未完成的elc解释器base文件
21647 由steve02081504与Alex0125设计、编写
21648 转载时请在不对此文件做任何修改的同时注明出处
21649 项目地址:https://github.com/steve02081504/ELC
21650 */
21651 namespace lib_loader_n{
21652 using namespace ::elc::APIs::library_load;
21653
21654 struct library_info_t;
21655 typedef comn_ptr_t<library_info_t> library_handle_t;
21656
21658 with_common_attribute<ref_able,never_in_array>,build_by_get_only{
21659 private:
21660 library_handle _m;
21661 string _name;
21662 string _error;
21663 public:
21664 constexpr explicit library_info_t(special_init_t)noexcept{
21665 _m=library_handle{0};
21666 _error=locale::str::lib_load::null_lib;
21667 attribute_ptr_cast<ref_able>(this)->init_never_ref_num_zero();
21668 }
21669 explicit library_info_t(string lib_name)noexcept{
21670 _name=lib_name;
21671 _m=load_library(lib_name);
21672
21673 if(!_m)
21674 _error=get_load_error();
21675 }
21677 free_library(_m);
21678 }
21679 [[nodiscard]]explicit operator bool()const noexcept{
21680 return bool(_m);
21681 }
21682 [[nodiscard]]string get_error()noexcept{
21683 return _error;
21684 }
21685 [[nodiscard]]string get_name()noexcept{
21686 return _name;
21687 }
21688
21689 [[nodiscard]]void*get_symbol(string symbol_name)noexcept{
21690 return APIs::library_load::get_symbol(_m,symbol_name);
21691 }
21692 template<class symbol_t>
21693 [[nodiscard]]symbol_t&get_symbol_as(string symbol_name)noexcept{
21694 return*reinterpret_cast<symbol_t*>(get_symbol(symbol_name));
21695 }
21696 template<class Func_t>
21697 [[nodiscard]]function_t<Func_t>get_symbol_as_function(string symbol_name)noexcept;
21698 };
21699 [[nodiscard]]inline bool the_pointer_to_bool(const library_info_t*a)noexcept{
21700 return a->operator bool();
21701 }
21703 [[nodiscard]]inline constexpr library_info_t*the_get_null_ptr(const library_info_t*)noexcept{return&null_lib;}
21704
21705 /*
21706 base_symbol_t
21707 容纳一个library_handle_t以引用计数lib资源
21708 同时容纳自身的符号名以方便反向查找名称
21709 */
21712 string _name;
21713 };
21714 /*
21715 symbol_t
21716 继承function_data_warpper_t的operator()以可转换为function_t
21717 继承base_symbol_t以对lib的引用计数和包含更多相关信息
21718 */
21719 template<class Func_t>
21720 struct symbol_t;
21721 #if !defined(_MSC_VER)
21722 template<class Ret_t,class...Args_t,bool nothrow>
21723 struct symbol_t<Ret_t(Args_t...)noexcept(nothrow)>:function_data_warpper_t<Ret_t(*)(Args_t...)noexcept(nothrow)>,base_symbol_t{
21724 symbol_t(library_handle_t lib,string symbol_name,Ret_t(*self)(Args_t...)noexcept(nothrow))noexcept:
21725 function_data_warpper_t<Ret_t(*)(Args_t...)noexcept(nothrow)>(self),base_symbol_t(lib,symbol_name){}
21726 };
21727 #else
21728 //MSVC,我滴垃圾堆
21729 template<class Ret_t,class...Args_t>
21730 struct symbol_t<Ret_t(Args_t...)>:function_data_warpper_t<Ret_t(*)(Args_t...)>,base_symbol_t{
21731 symbol_t(library_handle_t lib,string symbol_name,Ret_t(*self)(Args_t...))noexcept:
21732 function_data_warpper_t<Ret_t(*)(Args_t...)>(self),base_symbol_t(lib,symbol_name){}
21733 };
21734 template<class Ret_t,class...Args_t>
21735 struct symbol_t<Ret_t(Args_t...)noexcept>:function_data_warpper_t<Ret_t(*)(Args_t...)noexcept>,base_symbol_t{
21736 symbol_t(library_handle_t lib,string symbol_name,Ret_t(*self)(Args_t...)noexcept)noexcept:
21737 function_data_warpper_t<Ret_t(*)(Args_t...)noexcept>(self),base_symbol_t(lib,symbol_name){}
21738 };
21739 #endif
21740
21741 template<class Func_t>
21742 [[nodiscard]]inline function_t<Func_t>library_info_t::get_symbol_as_function(string symbol_name)noexcept{
21743 auto func_p=&get_symbol_as<Func_t>(symbol_name);
21744 if(!func_p)
21745 return null_ptr;
21746 else
21747 return symbol_t<Func_t>(this,symbol_name,func_p);
21748 }
21749
21750 [[nodiscard]]inline library_handle_t load_lib(string lib_name)noexcept{
21751 return get<library_info_t>(lib_name);
21752 }
21753 template<class Func_t>
21754 [[nodiscard]]inline library_handle_t get_library_handle_form_symbol(function_t<Func_t> symbol)noexcept{
21755 auto symbol_info=symbol.get_as<base_symbol_t>();
21756 if(symbol_info.fail())
21757 return null_ptr;
21758 else
21759 return symbol_info.get_ref()._lib;
21760 }
21761 template<class Func_t>
21762 [[nodiscard]]inline string get_symbol_name_form_symbol(function_t<Func_t> symbol)noexcept{
21763 auto symbol_info=symbol.get_as<base_symbol_t>();
21764 if(symbol_info.fail())
21765 return {};
21766 else
21767 return symbol_info.get_ref()._name;
21768 }
21769 }
21770
21771 //file_end
21772
21773 #line 20 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/lib_loader/_body.hpp"
21774 #if defined(ELC_TEST_ON)
21775 namespace lib_loader_part_test{
21776 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/lib_loader/_test.hpp"
21777 //_test.hpp
21778 /*
21779 未完成的elc解释器template文件
21780 由steve02081504与Alex0125设计、编写
21781 转载时请在不对此文件做任何修改的同时注明出处
21782 项目地址:https://github.com/steve02081504/ELC
21783 */
21784 inline void test(){
21785 ELC_TEST_EVENTNAME("lib_loader部分测试");
21786 }
21787 inline void test_log_out(){}
21788 inline void test_end{}
21789
21790 //file_end
21791
21792 #line 23 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/lib_loader/_body.hpp"
21793 }
21794 #endif
21795
21796 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
21797 //_undefs.hpp
21798 /*
21799 未完成的elc解释器basic文件
21800 由steve02081504与Alex0125设计、编写
21801 转载时请在不对此文件做任何修改的同时注明出处
21802 项目地址:https://github.com/steve02081504/ELC
21803 */
21804 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_undefs.hpp"
21805 //_undefs.hpp
21806 /*
21807 未完成的elc解释器_share文件
21808 由steve02081504与Alex0125设计、编写
21809 转载时请在不对此文件做任何修改的同时注明出处
21810 项目地址:https://github.com/steve02081504/ELC
21811 */
21812
21813 //defs at "_defs.hpp"
21814
21815 #if defined(_MSC_VER)
21816 #pragma warning(pop)
21817 #endif
21818 #undef suppress_msvc_warning
21819 #undef disable_msvc_warning
21820 #undef push_msvc_warning
21821 #undef pop_msvc_warning
21822 #undef push_and_disable_msvc_warning
21823
21824 //for basic_environment.hpp
21825 #undef BIT_POSSIBILITY
21826 //
21827 #if defined(ELC_VOID_NAME)
21828 #define void the_void
21829 #endif
21830
21831 // #undef often_noexcept
21832 #undef noexcept_as
21833 #undef noexcept_as_auto
21834 #undef constexpr_as
21835 #undef constexpr_as_auto
21836
21837 #undef using_method_from_base_t
21838 #undef using_method_from_value
21839
21840 #undef floop
21841 #undef enable_adl
21842
21843 #undef re_declvalue
21844 #undef re_decltype
21845
21846 #undef declvalue
21847
21848 #undef template_error
21849 #undef template_warning
21850
21851 #undef type_info_of
21852 #undef type_name_of
21853
21854 #undef is_common_attribute
21855 #undef is_special_attribute
21856
21857 #undef has_attribute
21858 #undef not_has_attribute
21859
21860 #undef float_size_of
21861 #undef bitnum_of
21862
21863 #undef def_common_attribute_with_nothing
21864 #undef def_special_attribute_with_nothing
21865
21866 #undef common_attribute_t
21867 #undef special_attribute_t
21868
21869 #undef enable_if
21870 #undef enabled_by_default
21871 #undef disabled_by_default
21872 #undef enable_if_not_ill_form
21873 #undef enable_flag
21874
21875 #undef was_an_ill_form
21876 #undef was_an_ill_form_with_parameter
21877 #undef was_not_an_ill_form
21878 #undef was_not_an_ill_form_and_noexcept
21879 #undef was_not_an_ill_form_with_parameter
21880
21881 #undef recursive_lambda
21882 #undef get_recursive_lambda_caller
21883 #undef lambda
21884 #undef lambda_with_catch
21885 #undef self_recursion
21886 #undef lambda_RLSRRS
21887
21888 #undef MAGIC
21889
21890 #undef nothing
21891
21892 #undef elseif
21893 #undef _big_than_
21894 #undef _small_than_
21895
21896 #if defined(_MSC_VER)
21897 #undef not
21898 #undef and
21899 #undef or
21900 #endif
21901
21902 #undef INTER_NAMESPACE
21903 #undef BREAK_NAMESPACE
21904
21905 #undef szie
21906 #undef form
21907
21908 #undef template_name
21909 #undef type_name
21910
21911 #undef not_in_debug
21912
21913 #undef es
21914 #undef ec
21915
21916 #undef ELC_TEST_EVENTNAME
21917
21918 #undef override_instance_struct
21919
21920 #undef distinctive
21921
21922 #undef force_inline
21923
21924 #undef with_no_vtable
21925
21926 #undef in_consteval
21927
21928 #undef no_vtable_struct
21929 #undef no_vtable_class
21930
21931 //file_end
21932
21933 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
21934
21935 //file_end
21936
21937 #line 27 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/lib_loader/_body.hpp"
21938 }
21939 namespace elc{
21940 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/lib_loader/_export.hpp"
21941 //_export.hpp
21942 //at namespace elc
21943 /*
21944 未完成的elc解释器template文件
21945 由steve02081504与Alex0125设计、编写
21946 转载时请在不对此文件做任何修改的同时注明出处
21947 项目地址:https://github.com/steve02081504/ELC
21948 */
21949 #define export using defs::lib_loader_n::
21954 #undef export
21955
21956 //file_end
21957
21958 #line 30 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/lib_loader/_body.hpp"
21959 }
21960
21961 //file_end
21962
21963 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/lib_loader"
21964 #endif
21965
21966 //file_end
21967
21968 #line 17 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/all"
21969 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/literal"
21970 //literal
21971 //at namespace ::
21972 /*
21973 未完成的elc解释器include文件
21974 由steve02081504与Alex0125设计、编写
21975 转载时请在不对此文件做任何修改的同时注明出处
21976 项目地址:https://github.com/steve02081504/ELC
21977 */
21978 #if !defined(ELC_LITERAL)
21979 #define ELC_LITERAL
21980 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/literal/_body.hpp"
21981 //_body.hpp
21982 //at namespace ::
21983 /*
21984 未完成的elc解释器literal文件
21985 由steve02081504与Alex0125设计、编写
21986 转载时请在不对此文件做任何修改的同时注明出处
21987 项目地址:https://github.com/steve02081504/ELC
21988 */
21989 #if defined(ELC_TEST)
21990 #error "this part cannot be tested."
21991 #endif
21992 namespace elc::defs{
21993 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
21994 //_defs.hpp
21995 /*
21996 未完成的elc解释器basic文件
21997 由steve02081504与Alex0125设计、编写
21998 转载时请在不对此文件做任何修改的同时注明出处
21999 项目地址:https://github.com/steve02081504/ELC
22000 */
22001 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
22002 //_defs.hpp
22003 /*
22004 未完成的elc解释器_share文件
22005 由steve02081504与Alex0125设计、编写
22006 转载时请在不对此文件做任何修改的同时注明出处
22007 项目地址:https://github.com/steve02081504/ELC
22008 */
22009
22010 //undefs at "_undefs.hpp"
22011
22012 //set ELC_WARNING_LEVEL default to 4(max)
22013 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
22014
22015 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/basic_environment.hpp"
22016 //basic_environment.hpp
22017 /*
22018 未完成的elc解释器_share文件
22019 由steve02081504与Alex0125设计、编写
22020 转载时请在不对此文件做任何修改的同时注明出处
22021 项目地址:https://github.com/steve02081504/ELC
22022 */
22023
22026 #define BIT_POSSIBILITY 2
22027
22028 //file_end
22029
22030 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
22031
22032 #if defined(_MSC_VER)
22033 #pragma warning(push,ELC_WARNING_LEVEL)
22034 #pragma warning(disable:4099)//class与struct混用警告diss
22035 #pragma warning(disable:26812)//enum class安利diss.
22036 #pragma warning(disable:4584)//重复子类警告diss
22037 #pragma warning(disable:4250)//域控制继承警告diss
22038 #pragma warning(disable:26432)//不完全默认方法警告diss
22039 #pragma warning(disable:26435)//virtual override方法警告diss
22040 #pragma warning(disable:26481)//容器安利diss
22041 #pragma warning(disable:26446)//gsl::at安利diss
22042 #pragma warning(disable:26434)//方法覆盖警告diss
22043 #pragma warning(disable:26429)//gsl::not_null安利diss
22044 #pragma warning(disable:26471)//对void*进行static_cast安利diss
22045 #pragma warning(disable:26474)//隐式指针转换显式cast警告diss
22046 #pragma warning(disable:26473)//相同指针显式cast警告diss
22047 #pragma warning(disable:26456)//隐藏非虚运算符警告diss
22048 #pragma warning(disable:26485)//数组作指针警告diss
22049 #pragma warning(disable:26490)//reinterpret_cast警告diss
22050 #pragma warning(disable:26472)//static_cast窄幅转换警告diss
22051 #pragma warning(disable:26482)//非常数数组索引警告diss
22052 #pragma warning(disable:26493)//c_cast转换警告diss:虽然有用但是太烦了,爬
22053 #endif
22054 #if defined(_MSC_VER)
22055 #define suppress_msvc_warning(...) __pragma(warning(suppress:__VA_ARGS__))
22056 #define disable_msvc_warning(...) __pragma(warning(disable:__VA_ARGS__))
22057 #define push_msvc_warning() __pragma(warning(push))
22058 #define pop_msvc_warning() __pragma(warning(pop))
22059 #define push_and_disable_msvc_warning(...) push_msvc_warning() disable_msvc_warning(__VA_ARGS__)
22060 #else
22061 #define suppress_msvc_warning(...)
22062 #define disable_msvc_warning(...)
22063 #define push_msvc_warning()
22064 #define pop_msvc_warning()
22065 #define push_and_disable_msvc_warning(...)
22066 #endif
22067 //
22068 #if defined(ELC_VOID_NAME)
22069 #undef void
22070 #endif
22071
22072 // #define often_noexcept
22073 #define noexcept_as(...) noexcept(noexcept((__VA_ARGS__)))//dnmd C艹标准就是没有noexcept_as_auto
22074 #define noexcept_as_auto MAGIC//哦现在有了
22075 #define constexpr_as(...) MAGIC constexpr//( •̀ ω •́ )✌
22076 #define constexpr_as_auto MAGIC MAGIC constexpr//✌( •̀ ω •́ )✌
22077
22078 #define using_method_from_base_t(name,...) \
22079 template<class...Args> requires was_not_an_ill_form(declvalue(base_t).name(declvalue(Args)...))\
22080 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(base_t::name(declvalue(Args)...))\
22081 {\
22082 return base_t::name(forward<Args>(rest)...);\
22083 }\
22084
22085 #define using_method_from_value(name,value_name,...) \
22086 template<class...Args> requires was_not_an_ill_form(re_declvalue(value_name).name(declvalue(Args)...))\
22087 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(re_declvalue(value_name).name(declvalue(Args)...))\
22088 {\
22089 return value_name.name(forward<Args>(rest)...);\
22090 }\
22091
22092 #define floop while(__builtin_is_my_dick_still_there())
22093 #define enable_adl(name) void name()noexcept=delete
22094
22095 #define re_declvalue(...) (declvalue(decltype(__VA_ARGS__)))
22096 #define re_decltype(...) (decltype(declvalue(__VA_ARGS__)))
22097
22098 #define declvalue(...) (::std::declval<__VA_ARGS__>())
22099
22101 #define template_error(reason) static_assert(template_error_helper<T>,reason)
22103 #define template_warning(reason) template_warning_helper<T>(reason)
22104
22105 //for type_info
22106 #define type_info_of(...) base_type_info_t(typeid(__VA_ARGS__))
22107 #define type_name_of(...) (type_info_of(__VA_ARGS__).name())
22108
22109 #define is_common_attribute(name) public attribute<T,name<T>>
22110 #define is_special_attribute(name) public attribute<T,name>
22111
22112 #define has_attribute(...) template_name has_attribute_helper<__VA_ARGS__>()
22113 #define not_has_attribute(...) template_name not_has_has_attribute_helper<__VA_ARGS__>()
22114
22115 //for float_size_t
22116 #define float_size_of(...) (float_size_t{sizeof(__VA_ARGS__)})
22117 //bitnum_of
22118 #define bitnum_of(...) (bitnumof<__VA_ARGS__>)
22119
22120 //for attribute
22121 #define def_common_attribute_with_nothing(name) \
22122 template<typename T>\
22123 class name{}\
22124
22125 #define def_special_attribute_with_nothing(name) \
22126 class name{}\
22127
22128 #define common_attribute_t template<class>class
22129 #define special_attribute_t class
22130
22139 #define enable_if(...) class enable_state= ::std::enable_if_t<__VA_ARGS__>
22141 #define enabled_by_default class enable_state=void
22143 #define disabled_by_default class enable_state= ::std::enable_if_t<false>
22145 #define enable_if_not_ill_form(...) class enable_state= ::std::void_t<decltype(__VA_ARGS__)>
22147 #define enable_flag class enable_state
22148
22149 #define was_an_ill_form(...) (!was_not_an_ill_form(__VA_ARGS__))
22150 #define was_an_ill_form_with_parameter(...) (!was_not_an_ill_form_with_parameter(__VA_ARGS__))
22151 #define was_not_an_ill_form(...) (bool(requires{__VA_ARGS__;}))
22152 #define was_not_an_ill_form_and_noexcept(...) (bool(requires{__VA_ARGS__;{__VA_ARGS__}noexcept;}))
22153 #define was_not_an_ill_form_with_parameter(...) (bool(requires __VA_ARGS__ ))
22154
22156 #define recursive_lambda(...) lambda(auto&&lambda_RLSRRS,__VA_ARGS__)
22158 #define get_recursive_lambda_caller(name) \
22159 lambda_with_catch(&)(auto&&...Args){\
22160 return name(name,Args...);\
22161 }
22163 #define lambda []
22165 #define lambda_with_catch(...) [__VA_ARGS__]
22167 #define self_recursion(...) lambda_RLSRRS(lambda_RLSRRS,__VA_ARGS__)
22168 //recursive_lambda_self_referential_reserved_symbolname
22169 #define lambda_RLSRRS _my_jb_super_sb_name_
22170
22171 #define MAGIC//ahh,ko no tenno da!
22172
22174 #define nothing
22175
22177 #define elseif else if
22179 #define _big_than_ >
22181 #define _small_than_ <
22182
22183 #if defined(_MSC_VER)
22184 #define not !
22185 #define and &&
22186 #define or ||
22187 #endif
22188
22190 #define INTER_NAMESPACE(NAMESPACENAME) namespace NAMESPACENAME{
22192 #define BREAK_NAMESPACE }
22193
22195 #define template_name template
22197 #define type_name class
22198
22199 #if defined(DEBUG) || defined(_DEBUG)
22200 #define not_in_debug 0
22201 #else
22202 #define not_in_debug 1
22203 #endif
22204
22205 #define es U""
22206 #define ec(ch) U ## ch
22207
22208 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
22209 #define ELC_TEST_EVENTNAME(name) stest_eventer _the_stest_eventer__(L""name)
22210 #else
22211 #define ELC_TEST_EVENTNAME(name)
22212 #endif
22213
22214 #define override_instance_struct \
22215 protected:\
22216 virtual void abstract_method_unget_this()noexcept_as(instance_struct<this_t>::abstract_method_unget_this())override{instance_struct<this_t>::abstract_method_unget_this();}\
22217 virtual void* _abstract_method_copy_get_this()noexcept_as(instance_struct<this_t>::_abstract_method_copy_get_this())override{return instance_struct<this_t>::_abstract_method_copy_get_this();}\
22218 virtual void* _abstract_method_get_resize_this(size_t size)noexcept_as(instance_struct<this_t>::instance_struct<this_t>::_abstract_method_get_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_resize_this(size);}\
22219 virtual void* _abstract_method_get_forward_resize_this(size_t size)noexcept_as(instance_struct<this_t>::_abstract_method_get_forward_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_forward_resize_this(size);}\
22220 virtual size_t abstract_method_get_size_of_get_for_this()noexcept override{return instance_struct<this_t>::abstract_method_get_size_of_get_for_this();}
22221
22222 #if defined(_WIN32)
22223 #define distinctive __declspec(dllexport)
22224 #else
22225 #define distinctive
22226 #endif
22227
22228 #if defined(_WIN32)
22229 #define force_inline __forceinline
22230 #elif defined(__GNUC__)
22231 #define force_inline __attribute__((always_inline)) inline
22232 #else
22233 #define force_inline inline
22234 #endif
22235
22236 #if defined(_WIN32)
22237 #define with_no_vtable __declspec(novtable)
22238 #else
22239 #define with_no_vtable
22240 #endif
22241
22242 #define in_consteval (::std::is_constant_evaluated())
22243
22244 #define no_vtable_struct struct with_no_vtable
22245 #define no_vtable_class class with_no_vtable
22246
22247 //file_end
22248
22249 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
22250
22251 //file_end
22252
22253 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/literal/_body.hpp"
22254
22255 #if defined(ELC_TEST_ON)
22256 namespace literal_part_test{
22257 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/literal/_test.hpp"
22258 //_test.hpp
22259 /*
22260 未完成的elc解释器literal文件
22261 由steve02081504与Alex0125设计、编写
22262 转载时请在不对此文件做任何修改的同时注明出处
22263 项目地址:https://github.com/steve02081504/ELC
22264 */
22265 inline void test(){
22266 ELC_TEST_EVENTNAME("literal部分测试");
22267 }
22268 inline void test_log_out(){
22269 }
22270 inline void test_end{
22271 }
22272
22273 //file_end
22274
22275 #line 17 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/literal/_body.hpp"
22276 }
22277 #endif
22278
22279 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
22280 //_undefs.hpp
22281 /*
22282 未完成的elc解释器basic文件
22283 由steve02081504与Alex0125设计、编写
22284 转载时请在不对此文件做任何修改的同时注明出处
22285 项目地址:https://github.com/steve02081504/ELC
22286 */
22287 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_undefs.hpp"
22288 //_undefs.hpp
22289 /*
22290 未完成的elc解释器_share文件
22291 由steve02081504与Alex0125设计、编写
22292 转载时请在不对此文件做任何修改的同时注明出处
22293 项目地址:https://github.com/steve02081504/ELC
22294 */
22295
22296 //defs at "_defs.hpp"
22297
22298 #if defined(_MSC_VER)
22299 #pragma warning(pop)
22300 #endif
22301 #undef suppress_msvc_warning
22302 #undef disable_msvc_warning
22303 #undef push_msvc_warning
22304 #undef pop_msvc_warning
22305 #undef push_and_disable_msvc_warning
22306
22307 //for basic_environment.hpp
22308 #undef BIT_POSSIBILITY
22309 //
22310 #if defined(ELC_VOID_NAME)
22311 #define void the_void
22312 #endif
22313
22314 // #undef often_noexcept
22315 #undef noexcept_as
22316 #undef noexcept_as_auto
22317 #undef constexpr_as
22318 #undef constexpr_as_auto
22319
22320 #undef using_method_from_base_t
22321 #undef using_method_from_value
22322
22323 #undef floop
22324 #undef enable_adl
22325
22326 #undef re_declvalue
22327 #undef re_decltype
22328
22329 #undef declvalue
22330
22331 #undef template_error
22332 #undef template_warning
22333
22334 #undef type_info_of
22335 #undef type_name_of
22336
22337 #undef is_common_attribute
22338 #undef is_special_attribute
22339
22340 #undef has_attribute
22341 #undef not_has_attribute
22342
22343 #undef float_size_of
22344 #undef bitnum_of
22345
22346 #undef def_common_attribute_with_nothing
22347 #undef def_special_attribute_with_nothing
22348
22349 #undef common_attribute_t
22350 #undef special_attribute_t
22351
22352 #undef enable_if
22353 #undef enabled_by_default
22354 #undef disabled_by_default
22355 #undef enable_if_not_ill_form
22356 #undef enable_flag
22357
22358 #undef was_an_ill_form
22359 #undef was_an_ill_form_with_parameter
22360 #undef was_not_an_ill_form
22361 #undef was_not_an_ill_form_and_noexcept
22362 #undef was_not_an_ill_form_with_parameter
22363
22364 #undef recursive_lambda
22365 #undef get_recursive_lambda_caller
22366 #undef lambda
22367 #undef lambda_with_catch
22368 #undef self_recursion
22369 #undef lambda_RLSRRS
22370
22371 #undef MAGIC
22372
22373 #undef nothing
22374
22375 #undef elseif
22376 #undef _big_than_
22377 #undef _small_than_
22378
22379 #if defined(_MSC_VER)
22380 #undef not
22381 #undef and
22382 #undef or
22383 #endif
22384
22385 #undef INTER_NAMESPACE
22386 #undef BREAK_NAMESPACE
22387
22388 #undef szie
22389 #undef form
22390
22391 #undef template_name
22392 #undef type_name
22393
22394 #undef not_in_debug
22395
22396 #undef es
22397 #undef ec
22398
22399 #undef ELC_TEST_EVENTNAME
22400
22401 #undef override_instance_struct
22402
22403 #undef distinctive
22404
22405 #undef force_inline
22406
22407 #undef with_no_vtable
22408
22409 #undef in_consteval
22410
22411 #undef no_vtable_struct
22412 #undef no_vtable_class
22413
22414 //file_end
22415
22416 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
22417
22418 //file_end
22419
22420 #line 21 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/literal/_body.hpp"
22421 }
22422 namespace elc{
22423 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/literal/_export.hpp"
22424 //_export.hpp
22425 //at namespace elc
22426 /*
22427 未完成的elc解释器literal文件
22428 由steve02081504与Alex0125设计、编写
22429 转载时请在不对此文件做任何修改的同时注明出处
22430 项目地址:https://github.com/steve02081504/ELC
22431 */
22432 #define export using ::
22433 #undef export
22434
22435 //file_end
22436
22437 #line 24 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/literal/_body.hpp"
22438 }
22439
22440 //file_end
22441
22442 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/literal"
22443 #endif
22444
22445 //file_end
22446
22447 #line 18 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/all"
22448 //#include "log"
22449 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/memory_stream"
22450 //memory_stream
22451 //at namespace ::
22452 /*
22453 未完成的elc解释器include文件
22454 由steve02081504与Alex0125设计、编写
22455 转载时请在不对此文件做任何修改的同时注明出处
22456 项目地址:https://github.com/steve02081504/ELC
22457 */
22458 #if !defined(ELC_MEMORY_STREAM)
22459 #define ELC_MEMORY_STREAM
22460 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/memory_stream/_body.hpp"
22461 //_body.hpp
22462 //at namespace ::
22463 /*
22464 未完成的elc解释器memory_stream文件
22465 由steve02081504与Alex0125设计、编写
22466 转载时请在不对此文件做任何修改的同时注明出处
22467 项目地址:https://github.com/steve02081504/ELC
22468 */
22469 #if defined(ELC_TEST)
22470 #error "this part cannot be tested."
22471 #endif
22472 namespace elc::defs{
22473 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
22474 //_defs.hpp
22475 /*
22476 未完成的elc解释器basic文件
22477 由steve02081504与Alex0125设计、编写
22478 转载时请在不对此文件做任何修改的同时注明出处
22479 项目地址:https://github.com/steve02081504/ELC
22480 */
22481 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
22482 //_defs.hpp
22483 /*
22484 未完成的elc解释器_share文件
22485 由steve02081504与Alex0125设计、编写
22486 转载时请在不对此文件做任何修改的同时注明出处
22487 项目地址:https://github.com/steve02081504/ELC
22488 */
22489
22490 //undefs at "_undefs.hpp"
22491
22492 //set ELC_WARNING_LEVEL default to 4(max)
22493 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
22494
22495 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/basic_environment.hpp"
22496 //basic_environment.hpp
22497 /*
22498 未完成的elc解释器_share文件
22499 由steve02081504与Alex0125设计、编写
22500 转载时请在不对此文件做任何修改的同时注明出处
22501 项目地址:https://github.com/steve02081504/ELC
22502 */
22503
22506 #define BIT_POSSIBILITY 2
22507
22508 //file_end
22509
22510 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
22511
22512 #if defined(_MSC_VER)
22513 #pragma warning(push,ELC_WARNING_LEVEL)
22514 #pragma warning(disable:4099)//class与struct混用警告diss
22515 #pragma warning(disable:26812)//enum class安利diss.
22516 #pragma warning(disable:4584)//重复子类警告diss
22517 #pragma warning(disable:4250)//域控制继承警告diss
22518 #pragma warning(disable:26432)//不完全默认方法警告diss
22519 #pragma warning(disable:26435)//virtual override方法警告diss
22520 #pragma warning(disable:26481)//容器安利diss
22521 #pragma warning(disable:26446)//gsl::at安利diss
22522 #pragma warning(disable:26434)//方法覆盖警告diss
22523 #pragma warning(disable:26429)//gsl::not_null安利diss
22524 #pragma warning(disable:26471)//对void*进行static_cast安利diss
22525 #pragma warning(disable:26474)//隐式指针转换显式cast警告diss
22526 #pragma warning(disable:26473)//相同指针显式cast警告diss
22527 #pragma warning(disable:26456)//隐藏非虚运算符警告diss
22528 #pragma warning(disable:26485)//数组作指针警告diss
22529 #pragma warning(disable:26490)//reinterpret_cast警告diss
22530 #pragma warning(disable:26472)//static_cast窄幅转换警告diss
22531 #pragma warning(disable:26482)//非常数数组索引警告diss
22532 #pragma warning(disable:26493)//c_cast转换警告diss:虽然有用但是太烦了,爬
22533 #endif
22534 #if defined(_MSC_VER)
22535 #define suppress_msvc_warning(...) __pragma(warning(suppress:__VA_ARGS__))
22536 #define disable_msvc_warning(...) __pragma(warning(disable:__VA_ARGS__))
22537 #define push_msvc_warning() __pragma(warning(push))
22538 #define pop_msvc_warning() __pragma(warning(pop))
22539 #define push_and_disable_msvc_warning(...) push_msvc_warning() disable_msvc_warning(__VA_ARGS__)
22540 #else
22541 #define suppress_msvc_warning(...)
22542 #define disable_msvc_warning(...)
22543 #define push_msvc_warning()
22544 #define pop_msvc_warning()
22545 #define push_and_disable_msvc_warning(...)
22546 #endif
22547 //
22548 #if defined(ELC_VOID_NAME)
22549 #undef void
22550 #endif
22551
22552 // #define often_noexcept
22553 #define noexcept_as(...) noexcept(noexcept((__VA_ARGS__)))//dnmd C艹标准就是没有noexcept_as_auto
22554 #define noexcept_as_auto MAGIC//哦现在有了
22555 #define constexpr_as(...) MAGIC constexpr//( •̀ ω •́ )✌
22556 #define constexpr_as_auto MAGIC MAGIC constexpr//✌( •̀ ω •́ )✌
22557
22558 #define using_method_from_base_t(name,...) \
22559 template<class...Args> requires was_not_an_ill_form(declvalue(base_t).name(declvalue(Args)...))\
22560 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(base_t::name(declvalue(Args)...))\
22561 {\
22562 return base_t::name(forward<Args>(rest)...);\
22563 }\
22564
22565 #define using_method_from_value(name,value_name,...) \
22566 template<class...Args> requires was_not_an_ill_form(re_declvalue(value_name).name(declvalue(Args)...))\
22567 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(re_declvalue(value_name).name(declvalue(Args)...))\
22568 {\
22569 return value_name.name(forward<Args>(rest)...);\
22570 }\
22571
22572 #define floop while(__builtin_is_my_dick_still_there())
22573 #define enable_adl(name) void name()noexcept=delete
22574
22575 #define re_declvalue(...) (declvalue(decltype(__VA_ARGS__)))
22576 #define re_decltype(...) (decltype(declvalue(__VA_ARGS__)))
22577
22578 #define declvalue(...) (::std::declval<__VA_ARGS__>())
22579
22581 #define template_error(reason) static_assert(template_error_helper<T>,reason)
22583 #define template_warning(reason) template_warning_helper<T>(reason)
22584
22585 //for type_info
22586 #define type_info_of(...) base_type_info_t(typeid(__VA_ARGS__))
22587 #define type_name_of(...) (type_info_of(__VA_ARGS__).name())
22588
22589 #define is_common_attribute(name) public attribute<T,name<T>>
22590 #define is_special_attribute(name) public attribute<T,name>
22591
22592 #define has_attribute(...) template_name has_attribute_helper<__VA_ARGS__>()
22593 #define not_has_attribute(...) template_name not_has_has_attribute_helper<__VA_ARGS__>()
22594
22595 //for float_size_t
22596 #define float_size_of(...) (float_size_t{sizeof(__VA_ARGS__)})
22597 //bitnum_of
22598 #define bitnum_of(...) (bitnumof<__VA_ARGS__>)
22599
22600 //for attribute
22601 #define def_common_attribute_with_nothing(name) \
22602 template<typename T>\
22603 class name{}\
22604
22605 #define def_special_attribute_with_nothing(name) \
22606 class name{}\
22607
22608 #define common_attribute_t template<class>class
22609 #define special_attribute_t class
22610
22619 #define enable_if(...) class enable_state= ::std::enable_if_t<__VA_ARGS__>
22621 #define enabled_by_default class enable_state=void
22623 #define disabled_by_default class enable_state= ::std::enable_if_t<false>
22625 #define enable_if_not_ill_form(...) class enable_state= ::std::void_t<decltype(__VA_ARGS__)>
22627 #define enable_flag class enable_state
22628
22629 #define was_an_ill_form(...) (!was_not_an_ill_form(__VA_ARGS__))
22630 #define was_an_ill_form_with_parameter(...) (!was_not_an_ill_form_with_parameter(__VA_ARGS__))
22631 #define was_not_an_ill_form(...) (bool(requires{__VA_ARGS__;}))
22632 #define was_not_an_ill_form_and_noexcept(...) (bool(requires{__VA_ARGS__;{__VA_ARGS__}noexcept;}))
22633 #define was_not_an_ill_form_with_parameter(...) (bool(requires __VA_ARGS__ ))
22634
22636 #define recursive_lambda(...) lambda(auto&&lambda_RLSRRS,__VA_ARGS__)
22638 #define get_recursive_lambda_caller(name) \
22639 lambda_with_catch(&)(auto&&...Args){\
22640 return name(name,Args...);\
22641 }
22643 #define lambda []
22645 #define lambda_with_catch(...) [__VA_ARGS__]
22647 #define self_recursion(...) lambda_RLSRRS(lambda_RLSRRS,__VA_ARGS__)
22648 //recursive_lambda_self_referential_reserved_symbolname
22649 #define lambda_RLSRRS _my_jb_super_sb_name_
22650
22651 #define MAGIC//ahh,ko no tenno da!
22652
22654 #define nothing
22655
22657 #define elseif else if
22659 #define _big_than_ >
22661 #define _small_than_ <
22662
22663 #if defined(_MSC_VER)
22664 #define not !
22665 #define and &&
22666 #define or ||
22667 #endif
22668
22670 #define INTER_NAMESPACE(NAMESPACENAME) namespace NAMESPACENAME{
22672 #define BREAK_NAMESPACE }
22673
22675 #define template_name template
22677 #define type_name class
22678
22679 #if defined(DEBUG) || defined(_DEBUG)
22680 #define not_in_debug 0
22681 #else
22682 #define not_in_debug 1
22683 #endif
22684
22685 #define es U""
22686 #define ec(ch) U ## ch
22687
22688 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
22689 #define ELC_TEST_EVENTNAME(name) stest_eventer _the_stest_eventer__(L""name)
22690 #else
22691 #define ELC_TEST_EVENTNAME(name)
22692 #endif
22693
22694 #define override_instance_struct \
22695 protected:\
22696 virtual void abstract_method_unget_this()noexcept_as(instance_struct<this_t>::abstract_method_unget_this())override{instance_struct<this_t>::abstract_method_unget_this();}\
22697 virtual void* _abstract_method_copy_get_this()noexcept_as(instance_struct<this_t>::_abstract_method_copy_get_this())override{return instance_struct<this_t>::_abstract_method_copy_get_this();}\
22698 virtual void* _abstract_method_get_resize_this(size_t size)noexcept_as(instance_struct<this_t>::instance_struct<this_t>::_abstract_method_get_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_resize_this(size);}\
22699 virtual void* _abstract_method_get_forward_resize_this(size_t size)noexcept_as(instance_struct<this_t>::_abstract_method_get_forward_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_forward_resize_this(size);}\
22700 virtual size_t abstract_method_get_size_of_get_for_this()noexcept override{return instance_struct<this_t>::abstract_method_get_size_of_get_for_this();}
22701
22702 #if defined(_WIN32)
22703 #define distinctive __declspec(dllexport)
22704 #else
22705 #define distinctive
22706 #endif
22707
22708 #if defined(_WIN32)
22709 #define force_inline __forceinline
22710 #elif defined(__GNUC__)
22711 #define force_inline __attribute__((always_inline)) inline
22712 #else
22713 #define force_inline inline
22714 #endif
22715
22716 #if defined(_WIN32)
22717 #define with_no_vtable __declspec(novtable)
22718 #else
22719 #define with_no_vtable
22720 #endif
22721
22722 #define in_consteval (::std::is_constant_evaluated())
22723
22724 #define no_vtable_struct struct with_no_vtable
22725 #define no_vtable_class class with_no_vtable
22726
22727 //file_end
22728
22729 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
22730
22731 //file_end
22732
22733 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/memory_stream/_body.hpp"
22734
22735 namespace stream_n{
22736 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/memory_stream/memory_stream.hpp"
22737 //memory_stream.hpp
22738 //at namespace elc::defs
22739 /*
22740 未完成的elc解释器memory_stream文件
22741 由steve02081504与Alex0125设计、编写
22742 转载时请在不对此文件做任何修改的同时注明出处
22743 项目地址:https://github.com/steve02081504/ELC
22744 */
22746 byte* _m;
22747 size_t _s;
22748 size_t _pos;
22749 memory_stream()noexcept{
22750 _m = get<byte>[1024]();
22751 _pos = 0;
22752 _s = 0;
22753 }
22755 unget(_m);
22756 }
22757 [[nodiscard]]size_t bufsize()const noexcept{
22758 return get_size_of_get(_m);
22759 }
22760 virtual void* seek(seek_type st,int_t offsize)noexcept override{
22761 switch(st){
22762 case beg:
22763 _pos = 0;
22764 return _m;
22765 case cur:
22766 _pos += (ptrdiff_t)offsize;
22767 return _m + _pos;
22768 case end:
22769 _pos = _s;
22770 return _m+_pos;
22771 default:
22772 return nullptr;
22773 }
22774 }
22775 virtual void seek_to(void*p)noexcept override{
22776 _pos = ((byte*)p)-_m;
22777 }
22778 virtual void sync()noexcept override{
22779 //do nothing
22780 }
22781 virtual void flush()noexcept override{
22782 //do nothing
22783 }
22784 virtual void close()noexcept override{
22785 unget(_m);
22786 _m = nullptr;
22787 _s = 0;
22788 }
22789 virtual void write(const byte*buf,size_t size)noexcept override{
22790 if(size>this->bufsize()-_pos)
22791 get_resize(_m,get_next_gold_size_to_resize_for_array(_pos+size));
22792 ::std::memcpy(_m+_pos,buf,size);
22793 _pos += size;
22794 _s = max(_pos,_s);
22795 }
22796 virtual size_t read(byte*buf,size_t size)noexcept override{
22797 if(_pos+size>_s)
22798 size = _s-_pos;
22799 ::std::memcpy(buf,_m+_pos,size);
22800 _pos += size;
22801 return size;
22802 }
22803 };
22804
22805 //file_end
22806
22807 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/memory_stream/_body.hpp"
22808 }
22809
22810 #if defined(ELC_TEST_ON)
22811 namespace memory_stream_part_test{
22812 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/memory_stream/_test.hpp"
22813 //_test.hpp
22814 /*
22815 未完成的elc解释器memory_stream文件
22816 由steve02081504与Alex0125设计、编写
22817 转载时请在不对此文件做任何修改的同时注明出处
22818 项目地址:https://github.com/steve02081504/ELC
22819 */
22820 inline void test(){
22821 ELC_TEST_EVENTNAME("memory_stream部分测试");
22822 }
22823 inline void test_log_out(){
22824 }
22825 inline void test_end(){
22826 }
22827
22828 //file_end
22829
22830 #line 21 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/memory_stream/_body.hpp"
22831 }
22832 #endif
22833
22834 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
22835 //_undefs.hpp
22836 /*
22837 未完成的elc解释器basic文件
22838 由steve02081504与Alex0125设计、编写
22839 转载时请在不对此文件做任何修改的同时注明出处
22840 项目地址:https://github.com/steve02081504/ELC
22841 */
22842 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_undefs.hpp"
22843 //_undefs.hpp
22844 /*
22845 未完成的elc解释器_share文件
22846 由steve02081504与Alex0125设计、编写
22847 转载时请在不对此文件做任何修改的同时注明出处
22848 项目地址:https://github.com/steve02081504/ELC
22849 */
22850
22851 //defs at "_defs.hpp"
22852
22853 #if defined(_MSC_VER)
22854 #pragma warning(pop)
22855 #endif
22856 #undef suppress_msvc_warning
22857 #undef disable_msvc_warning
22858 #undef push_msvc_warning
22859 #undef pop_msvc_warning
22860 #undef push_and_disable_msvc_warning
22861
22862 //for basic_environment.hpp
22863 #undef BIT_POSSIBILITY
22864 //
22865 #if defined(ELC_VOID_NAME)
22866 #define void the_void
22867 #endif
22868
22869 // #undef often_noexcept
22870 #undef noexcept_as
22871 #undef noexcept_as_auto
22872 #undef constexpr_as
22873 #undef constexpr_as_auto
22874
22875 #undef using_method_from_base_t
22876 #undef using_method_from_value
22877
22878 #undef floop
22879 #undef enable_adl
22880
22881 #undef re_declvalue
22882 #undef re_decltype
22883
22884 #undef declvalue
22885
22886 #undef template_error
22887 #undef template_warning
22888
22889 #undef type_info_of
22890 #undef type_name_of
22891
22892 #undef is_common_attribute
22893 #undef is_special_attribute
22894
22895 #undef has_attribute
22896 #undef not_has_attribute
22897
22898 #undef float_size_of
22899 #undef bitnum_of
22900
22901 #undef def_common_attribute_with_nothing
22902 #undef def_special_attribute_with_nothing
22903
22904 #undef common_attribute_t
22905 #undef special_attribute_t
22906
22907 #undef enable_if
22908 #undef enabled_by_default
22909 #undef disabled_by_default
22910 #undef enable_if_not_ill_form
22911 #undef enable_flag
22912
22913 #undef was_an_ill_form
22914 #undef was_an_ill_form_with_parameter
22915 #undef was_not_an_ill_form
22916 #undef was_not_an_ill_form_and_noexcept
22917 #undef was_not_an_ill_form_with_parameter
22918
22919 #undef recursive_lambda
22920 #undef get_recursive_lambda_caller
22921 #undef lambda
22922 #undef lambda_with_catch
22923 #undef self_recursion
22924 #undef lambda_RLSRRS
22925
22926 #undef MAGIC
22927
22928 #undef nothing
22929
22930 #undef elseif
22931 #undef _big_than_
22932 #undef _small_than_
22933
22934 #if defined(_MSC_VER)
22935 #undef not
22936 #undef and
22937 #undef or
22938 #endif
22939
22940 #undef INTER_NAMESPACE
22941 #undef BREAK_NAMESPACE
22942
22943 #undef szie
22944 #undef form
22945
22946 #undef template_name
22947 #undef type_name
22948
22949 #undef not_in_debug
22950
22951 #undef es
22952 #undef ec
22953
22954 #undef ELC_TEST_EVENTNAME
22955
22956 #undef override_instance_struct
22957
22958 #undef distinctive
22959
22960 #undef force_inline
22961
22962 #undef with_no_vtable
22963
22964 #undef in_consteval
22965
22966 #undef no_vtable_struct
22967 #undef no_vtable_class
22968
22969 //file_end
22970
22971 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
22972
22973 //file_end
22974
22975 #line 25 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/memory_stream/_body.hpp"
22976 }
22977 namespace elc{
22978 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/memory_stream/_export.hpp"
22979 //_export.hpp
22980 //at namespace elc
22981 /*
22982 未完成的elc解释器memory_stream文件
22983 由steve02081504与Alex0125设计、编写
22984 转载时请在不对此文件做任何修改的同时注明出处
22985 项目地址:https://github.com/steve02081504/ELC
22986 */
22987 #define export using defs::
22988 export memory_stream;
22989 #undef export
22990
22991 //file_end
22992
22993 #line 28 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/memory_stream/_body.hpp"
22994 }
22995
22996 //file_end
22997
22998 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/memory_stream"
22999 #endif
23000
23001 //file_end
23002
23003 #line 20 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/all"
23004 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/namespace"
23005 //namespace
23006 //at namespace ::
23007 /*
23008 未完成的elc解释器include文件
23009 由steve02081504与Alex0125设计、编写
23010 转载时请在不对此文件做任何修改的同时注明出处
23011 项目地址:https://github.com/steve02081504/ELC
23012 */
23013 #if !defined(ELC_NAMESPACE)
23014 #define ELC_NAMESPACE
23015 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/core"
23016 //core
23017 //at namespace ::
23018 /*
23019 未完成的elc解释器include文件
23020 由steve02081504与Alex0125设计、编写
23021 转载时请在不对此文件做任何修改的同时注明出处
23022 项目地址:https://github.com/steve02081504/ELC
23023 */
23024 #line 15 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/core"
23025
23026 //file_end
23027
23028 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/namespace"
23029 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/string"
23030 //string
23031 //at namespace ::
23032 /*
23033 未完成的elc解释器include文件
23034 由steve02081504与Alex0125设计、编写
23035 转载时请在不对此文件做任何修改的同时注明出处
23036 项目地址:https://github.com/steve02081504/ELC
23037 */
23038 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/string"
23039
23040 //file_end
23041
23042 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/namespace"
23043 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/namespace/_body.hpp"
23044 //_body.hpp
23045 //at namespace ::
23046 /*
23047 未完成的elc解释器namespace文件
23048 由steve02081504与Alex0125设计、编写
23049 转载时请在不对此文件做任何修改的同时注明出处
23050 项目地址:https://github.com/steve02081504/ELC
23051 */
23052 #if defined(ELC_TEST)
23053 #error "this part cannot be tested."
23054 #endif
23055 namespace elc::defs{
23056 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
23057 //_defs.hpp
23058 /*
23059 未完成的elc解释器basic文件
23060 由steve02081504与Alex0125设计、编写
23061 转载时请在不对此文件做任何修改的同时注明出处
23062 项目地址:https://github.com/steve02081504/ELC
23063 */
23064 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
23065 //_defs.hpp
23066 /*
23067 未完成的elc解释器_share文件
23068 由steve02081504与Alex0125设计、编写
23069 转载时请在不对此文件做任何修改的同时注明出处
23070 项目地址:https://github.com/steve02081504/ELC
23071 */
23072
23073 //undefs at "_undefs.hpp"
23074
23075 //set ELC_WARNING_LEVEL default to 4(max)
23076 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
23077
23078 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/basic_environment.hpp"
23079 //basic_environment.hpp
23080 /*
23081 未完成的elc解释器_share文件
23082 由steve02081504与Alex0125设计、编写
23083 转载时请在不对此文件做任何修改的同时注明出处
23084 项目地址:https://github.com/steve02081504/ELC
23085 */
23086
23089 #define BIT_POSSIBILITY 2
23090
23091 //file_end
23092
23093 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
23094
23095 #if defined(_MSC_VER)
23096 #pragma warning(push,ELC_WARNING_LEVEL)
23097 #pragma warning(disable:4099)//class与struct混用警告diss
23098 #pragma warning(disable:26812)//enum class安利diss.
23099 #pragma warning(disable:4584)//重复子类警告diss
23100 #pragma warning(disable:4250)//域控制继承警告diss
23101 #pragma warning(disable:26432)//不完全默认方法警告diss
23102 #pragma warning(disable:26435)//virtual override方法警告diss
23103 #pragma warning(disable:26481)//容器安利diss
23104 #pragma warning(disable:26446)//gsl::at安利diss
23105 #pragma warning(disable:26434)//方法覆盖警告diss
23106 #pragma warning(disable:26429)//gsl::not_null安利diss
23107 #pragma warning(disable:26471)//对void*进行static_cast安利diss
23108 #pragma warning(disable:26474)//隐式指针转换显式cast警告diss
23109 #pragma warning(disable:26473)//相同指针显式cast警告diss
23110 #pragma warning(disable:26456)//隐藏非虚运算符警告diss
23111 #pragma warning(disable:26485)//数组作指针警告diss
23112 #pragma warning(disable:26490)//reinterpret_cast警告diss
23113 #pragma warning(disable:26472)//static_cast窄幅转换警告diss
23114 #pragma warning(disable:26482)//非常数数组索引警告diss
23115 #pragma warning(disable:26493)//c_cast转换警告diss:虽然有用但是太烦了,爬
23116 #endif
23117 #if defined(_MSC_VER)
23118 #define suppress_msvc_warning(...) __pragma(warning(suppress:__VA_ARGS__))
23119 #define disable_msvc_warning(...) __pragma(warning(disable:__VA_ARGS__))
23120 #define push_msvc_warning() __pragma(warning(push))
23121 #define pop_msvc_warning() __pragma(warning(pop))
23122 #define push_and_disable_msvc_warning(...) push_msvc_warning() disable_msvc_warning(__VA_ARGS__)
23123 #else
23124 #define suppress_msvc_warning(...)
23125 #define disable_msvc_warning(...)
23126 #define push_msvc_warning()
23127 #define pop_msvc_warning()
23128 #define push_and_disable_msvc_warning(...)
23129 #endif
23130 //
23131 #if defined(ELC_VOID_NAME)
23132 #undef void
23133 #endif
23134
23135 // #define often_noexcept
23136 #define noexcept_as(...) noexcept(noexcept((__VA_ARGS__)))//dnmd C艹标准就是没有noexcept_as_auto
23137 #define noexcept_as_auto MAGIC//哦现在有了
23138 #define constexpr_as(...) MAGIC constexpr//( •̀ ω •́ )✌
23139 #define constexpr_as_auto MAGIC MAGIC constexpr//✌( •̀ ω •́ )✌
23140
23141 #define using_method_from_base_t(name,...) \
23142 template<class...Args> requires was_not_an_ill_form(declvalue(base_t).name(declvalue(Args)...))\
23143 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(base_t::name(declvalue(Args)...))\
23144 {\
23145 return base_t::name(forward<Args>(rest)...);\
23146 }\
23147
23148 #define using_method_from_value(name,value_name,...) \
23149 template<class...Args> requires was_not_an_ill_form(re_declvalue(value_name).name(declvalue(Args)...))\
23150 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(re_declvalue(value_name).name(declvalue(Args)...))\
23151 {\
23152 return value_name.name(forward<Args>(rest)...);\
23153 }\
23154
23155 #define floop while(__builtin_is_my_dick_still_there())
23156 #define enable_adl(name) void name()noexcept=delete
23157
23158 #define re_declvalue(...) (declvalue(decltype(__VA_ARGS__)))
23159 #define re_decltype(...) (decltype(declvalue(__VA_ARGS__)))
23160
23161 #define declvalue(...) (::std::declval<__VA_ARGS__>())
23162
23164 #define template_error(reason) static_assert(template_error_helper<T>,reason)
23166 #define template_warning(reason) template_warning_helper<T>(reason)
23167
23168 //for type_info
23169 #define type_info_of(...) base_type_info_t(typeid(__VA_ARGS__))
23170 #define type_name_of(...) (type_info_of(__VA_ARGS__).name())
23171
23172 #define is_common_attribute(name) public attribute<T,name<T>>
23173 #define is_special_attribute(name) public attribute<T,name>
23174
23175 #define has_attribute(...) template_name has_attribute_helper<__VA_ARGS__>()
23176 #define not_has_attribute(...) template_name not_has_has_attribute_helper<__VA_ARGS__>()
23177
23178 //for float_size_t
23179 #define float_size_of(...) (float_size_t{sizeof(__VA_ARGS__)})
23180 //bitnum_of
23181 #define bitnum_of(...) (bitnumof<__VA_ARGS__>)
23182
23183 //for attribute
23184 #define def_common_attribute_with_nothing(name) \
23185 template<typename T>\
23186 class name{}\
23187
23188 #define def_special_attribute_with_nothing(name) \
23189 class name{}\
23190
23191 #define common_attribute_t template<class>class
23192 #define special_attribute_t class
23193
23202 #define enable_if(...) class enable_state= ::std::enable_if_t<__VA_ARGS__>
23204 #define enabled_by_default class enable_state=void
23206 #define disabled_by_default class enable_state= ::std::enable_if_t<false>
23208 #define enable_if_not_ill_form(...) class enable_state= ::std::void_t<decltype(__VA_ARGS__)>
23210 #define enable_flag class enable_state
23211
23212 #define was_an_ill_form(...) (!was_not_an_ill_form(__VA_ARGS__))
23213 #define was_an_ill_form_with_parameter(...) (!was_not_an_ill_form_with_parameter(__VA_ARGS__))
23214 #define was_not_an_ill_form(...) (bool(requires{__VA_ARGS__;}))
23215 #define was_not_an_ill_form_and_noexcept(...) (bool(requires{__VA_ARGS__;{__VA_ARGS__}noexcept;}))
23216 #define was_not_an_ill_form_with_parameter(...) (bool(requires __VA_ARGS__ ))
23217
23219 #define recursive_lambda(...) lambda(auto&&lambda_RLSRRS,__VA_ARGS__)
23221 #define get_recursive_lambda_caller(name) \
23222 lambda_with_catch(&)(auto&&...Args){\
23223 return name(name,Args...);\
23224 }
23226 #define lambda []
23228 #define lambda_with_catch(...) [__VA_ARGS__]
23230 #define self_recursion(...) lambda_RLSRRS(lambda_RLSRRS,__VA_ARGS__)
23231 //recursive_lambda_self_referential_reserved_symbolname
23232 #define lambda_RLSRRS _my_jb_super_sb_name_
23233
23234 #define MAGIC//ahh,ko no tenno da!
23235
23237 #define nothing
23238
23240 #define elseif else if
23242 #define _big_than_ >
23244 #define _small_than_ <
23245
23246 #if defined(_MSC_VER)
23247 #define not !
23248 #define and &&
23249 #define or ||
23250 #endif
23251
23253 #define INTER_NAMESPACE(NAMESPACENAME) namespace NAMESPACENAME{
23255 #define BREAK_NAMESPACE }
23256
23258 #define template_name template
23260 #define type_name class
23261
23262 #if defined(DEBUG) || defined(_DEBUG)
23263 #define not_in_debug 0
23264 #else
23265 #define not_in_debug 1
23266 #endif
23267
23268 #define es U""
23269 #define ec(ch) U ## ch
23270
23271 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
23272 #define ELC_TEST_EVENTNAME(name) stest_eventer _the_stest_eventer__(L""name)
23273 #else
23274 #define ELC_TEST_EVENTNAME(name)
23275 #endif
23276
23277 #define override_instance_struct \
23278 protected:\
23279 virtual void abstract_method_unget_this()noexcept_as(instance_struct<this_t>::abstract_method_unget_this())override{instance_struct<this_t>::abstract_method_unget_this();}\
23280 virtual void* _abstract_method_copy_get_this()noexcept_as(instance_struct<this_t>::_abstract_method_copy_get_this())override{return instance_struct<this_t>::_abstract_method_copy_get_this();}\
23281 virtual void* _abstract_method_get_resize_this(size_t size)noexcept_as(instance_struct<this_t>::instance_struct<this_t>::_abstract_method_get_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_resize_this(size);}\
23282 virtual void* _abstract_method_get_forward_resize_this(size_t size)noexcept_as(instance_struct<this_t>::_abstract_method_get_forward_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_forward_resize_this(size);}\
23283 virtual size_t abstract_method_get_size_of_get_for_this()noexcept override{return instance_struct<this_t>::abstract_method_get_size_of_get_for_this();}
23284
23285 #if defined(_WIN32)
23286 #define distinctive __declspec(dllexport)
23287 #else
23288 #define distinctive
23289 #endif
23290
23291 #if defined(_WIN32)
23292 #define force_inline __forceinline
23293 #elif defined(__GNUC__)
23294 #define force_inline __attribute__((always_inline)) inline
23295 #else
23296 #define force_inline inline
23297 #endif
23298
23299 #if defined(_WIN32)
23300 #define with_no_vtable __declspec(novtable)
23301 #else
23302 #define with_no_vtable
23303 #endif
23304
23305 #define in_consteval (::std::is_constant_evaluated())
23306
23307 #define no_vtable_struct struct with_no_vtable
23308 #define no_vtable_class class with_no_vtable
23309
23310 //file_end
23311
23312 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
23313
23314 //file_end
23315
23316 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/namespace/_body.hpp"
23317
23318 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/namespace/defs.hpp"
23319 //defs.hpp
23320 /*
23321 未完成的elc解释器namespace文件
23322 由steve02081504与Alex0125设计、编写
23323 转载时请在不对此文件做任何修改的同时注明出处
23324 项目地址:https://github.com/steve02081504/ELC
23325 */
23326 namespace core{
23327 template<>
23328 distinctive inline map_t<ptr,string> long_term_binary_node_storager<string>{};
23329 }
23330 namespace namespace_n{
23334 value get_symbol_type_map(ptr thenamespace){
23335 return (*thenamespace)[es".symbol_type_map"];
23336 }
23337 namespace_t()noexcept{
23338 _namespace_root = get<common_node>();
23339 auto&nmsp = *_namespace_root;
23340 _namespace_now = &nmsp;
23341 push_and_disable_msvc_warning(26447);//may throw警告diss
23342 nmsp[es".."] = the_void;
23343 nmsp[es"."] = nmsp;
23344 nmsp[es"t"] = t;
23345 nmsp[es"nil"] = nil;
23346 nmsp[es"void"] = the_void;
23347 value nmsptm = get_symbol_type_map(&nmsp);
23348 nmsptm = get<common_node>();
23349 nmsptm[es"void"] = es"void";
23351 }
23352 ptr get_symbol_namespace(const value index){
23353 ptr namespace_now_p = _namespace_now;
23354 while(namespace_now_p && !(*namespace_now_p)[index] && !get_symbol_type_map(namespace_now_p)[index])
23355 namespace_now_p = (*namespace_now_p)[es".."];
23356 return namespace_now_p;
23357 }
23358 ptr get_symbol_namespace(auto&& index){ return get_symbol_namespace(as_value(index)); }
23359 bool has_symbol(const value index){
23360 auto nmsp=get_symbol_namespace(index);
23361 if((*nmsp)[index] || get_symbol_type_map(nmsp)[index])
23362 return true;
23363 return false;
23364 }
23365 bool has_symbol(auto&& index){ return has_symbol(as_value(index)); }
23366 value get_symbol(const value index){
23367 return (*get_symbol_namespace(index))[index];
23368 }
23369 value get_symbol(auto&& index){ return get_symbol(as_value(index)); }
23370 value get_symbol_type(const value index){
23371 return get_symbol_type_map(get_symbol_namespace(index))[index];
23372 }
23373 value get_symbol_type(auto&& index){ return get_symbol_type(as_value(index)); }
23374
23375 void inter_namespace(const value namespace_name){
23376 _namespace_now = get_symbol(namespace_name);
23377 }
23378 void inter_namespace(auto&& index){ inter_namespace(as_value(index)); }
23379
23380 void leave_namespace(){ inter_namespace(es".."); }
23381 }names{};
23382 }
23383
23384 //file_end
23385
23386 #line 15 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/namespace/_body.hpp"
23387
23388 #if defined(ELC_TEST_ON)
23389 namespace namespace_part_test{
23390 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/namespace/_test.hpp"
23391 //_test.hpp
23392 /*
23393 未完成的elc解释器namespace文件
23394 由steve02081504与Alex0125设计、编写
23395 转载时请在不对此文件做任何修改的同时注明出处
23396 项目地址:https://github.com/steve02081504/ELC
23397 */
23398 inline void test(){
23399 ELC_TEST_EVENTNAME("namespace部分测试");
23400 }
23401 inline void test_log_out(){
23402 }
23403 inline void test_end{
23404 }
23405
23406 //file_end
23407
23408 #line 19 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/namespace/_body.hpp"
23409 }
23410 #endif
23411
23412 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
23413 //_undefs.hpp
23414 /*
23415 未完成的elc解释器basic文件
23416 由steve02081504与Alex0125设计、编写
23417 转载时请在不对此文件做任何修改的同时注明出处
23418 项目地址:https://github.com/steve02081504/ELC
23419 */
23420 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_undefs.hpp"
23421 //_undefs.hpp
23422 /*
23423 未完成的elc解释器_share文件
23424 由steve02081504与Alex0125设计、编写
23425 转载时请在不对此文件做任何修改的同时注明出处
23426 项目地址:https://github.com/steve02081504/ELC
23427 */
23428
23429 //defs at "_defs.hpp"
23430
23431 #if defined(_MSC_VER)
23432 #pragma warning(pop)
23433 #endif
23434 #undef suppress_msvc_warning
23435 #undef disable_msvc_warning
23436 #undef push_msvc_warning
23437 #undef pop_msvc_warning
23438 #undef push_and_disable_msvc_warning
23439
23440 //for basic_environment.hpp
23441 #undef BIT_POSSIBILITY
23442 //
23443 #if defined(ELC_VOID_NAME)
23444 #define void the_void
23445 #endif
23446
23447 // #undef often_noexcept
23448 #undef noexcept_as
23449 #undef noexcept_as_auto
23450 #undef constexpr_as
23451 #undef constexpr_as_auto
23452
23453 #undef using_method_from_base_t
23454 #undef using_method_from_value
23455
23456 #undef floop
23457 #undef enable_adl
23458
23459 #undef re_declvalue
23460 #undef re_decltype
23461
23462 #undef declvalue
23463
23464 #undef template_error
23465 #undef template_warning
23466
23467 #undef type_info_of
23468 #undef type_name_of
23469
23470 #undef is_common_attribute
23471 #undef is_special_attribute
23472
23473 #undef has_attribute
23474 #undef not_has_attribute
23475
23476 #undef float_size_of
23477 #undef bitnum_of
23478
23479 #undef def_common_attribute_with_nothing
23480 #undef def_special_attribute_with_nothing
23481
23482 #undef common_attribute_t
23483 #undef special_attribute_t
23484
23485 #undef enable_if
23486 #undef enabled_by_default
23487 #undef disabled_by_default
23488 #undef enable_if_not_ill_form
23489 #undef enable_flag
23490
23491 #undef was_an_ill_form
23492 #undef was_an_ill_form_with_parameter
23493 #undef was_not_an_ill_form
23494 #undef was_not_an_ill_form_and_noexcept
23495 #undef was_not_an_ill_form_with_parameter
23496
23497 #undef recursive_lambda
23498 #undef get_recursive_lambda_caller
23499 #undef lambda
23500 #undef lambda_with_catch
23501 #undef self_recursion
23502 #undef lambda_RLSRRS
23503
23504 #undef MAGIC
23505
23506 #undef nothing
23507
23508 #undef elseif
23509 #undef _big_than_
23510 #undef _small_than_
23511
23512 #if defined(_MSC_VER)
23513 #undef not
23514 #undef and
23515 #undef or
23516 #endif
23517
23518 #undef INTER_NAMESPACE
23519 #undef BREAK_NAMESPACE
23520
23521 #undef szie
23522 #undef form
23523
23524 #undef template_name
23525 #undef type_name
23526
23527 #undef not_in_debug
23528
23529 #undef es
23530 #undef ec
23531
23532 #undef ELC_TEST_EVENTNAME
23533
23534 #undef override_instance_struct
23535
23536 #undef distinctive
23537
23538 #undef force_inline
23539
23540 #undef with_no_vtable
23541
23542 #undef in_consteval
23543
23544 #undef no_vtable_struct
23545 #undef no_vtable_class
23546
23547 //file_end
23548
23549 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
23550
23551 //file_end
23552
23553 #line 23 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/namespace/_body.hpp"
23554 }
23555 namespace elc{
23556 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/namespace/_export.hpp"
23557 //_export.hpp
23558 //at namespace elc
23559 /*
23560 未完成的elc解释器namespace文件
23561 由steve02081504与Alex0125设计、编写
23562 转载时请在不对此文件做任何修改的同时注明出处
23563 项目地址:https://github.com/steve02081504/ELC
23564 */
23565 #define export using defs::
23566 export namespace_n::names;
23567 #undef export
23568
23569 //file_end
23570
23571 #line 26 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/namespace/_body.hpp"
23572 }
23573
23574 //file_end
23575
23576 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/namespace"
23577 #endif
23578
23579 //file_end
23580
23581 #line 21 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/all"
23582 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/numerical_representation"
23583 //numerical_representation
23584 //at namespace ::
23585 /*
23586 未完成的elc解释器include文件
23587 由steve02081504与Alex0125设计、编写
23588 转载时请在不对此文件做任何修改的同时注明出处
23589 项目地址:https://github.com/steve02081504/ELC
23590 */
23591 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/numerical_representation"
23592
23593 //file_end
23594
23595 #line 22 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/all"
23596 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/package_symbol_loader"
23597 //lib_loader
23598 //at namespace ::
23599 /*
23600 未完成的elc解释器include文件
23601 由steve02081504与Alex0125设计、编写
23602 转载时请在不对此文件做任何修改的同时注明出处
23603 项目地址:https://github.com/steve02081504/ELC
23604 */
23605 #if !defined(ELC_PACKAGE_SYMBOL_LOADER)
23606 #define ELC_PACKAGE_SYMBOL_LOADER
23607 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/core"
23608 //core
23609 //at namespace ::
23610 /*
23611 未完成的elc解释器include文件
23612 由steve02081504与Alex0125设计、编写
23613 转载时请在不对此文件做任何修改的同时注明出处
23614 项目地址:https://github.com/steve02081504/ELC
23615 */
23616 #line 15 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/core"
23617
23618 //file_end
23619
23620 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/package_symbol_loader"
23621 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/string"
23622 //string
23623 //at namespace ::
23624 /*
23625 未完成的elc解释器include文件
23626 由steve02081504与Alex0125设计、编写
23627 转载时请在不对此文件做任何修改的同时注明出处
23628 项目地址:https://github.com/steve02081504/ELC
23629 */
23630 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/string"
23631
23632 //file_end
23633
23634 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/package_symbol_loader"
23635 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/lib_loader"
23636 //lib_loader
23637 //at namespace ::
23638 /*
23639 未完成的elc解释器include文件
23640 由steve02081504与Alex0125设计、编写
23641 转载时请在不对此文件做任何修改的同时注明出处
23642 项目地址:https://github.com/steve02081504/ELC
23643 */
23644 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/lib_loader"
23645
23646 //file_end
23647
23648 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/package_symbol_loader"
23649 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/package_symbol_loader/_body.hpp"
23650 //_body.hpp
23651 //at namespace ::
23652 /*
23653 未完成的elc解释器template文件
23654 由steve02081504与Alex0125设计、编写
23655 转载时请在不对此文件做任何修改的同时注明出处
23656 项目地址:https://github.com/steve02081504/ELC
23657 */
23658 #if defined(ELC_TEST)
23659 #error "this part cannot be tested."
23660 #endif
23661 //include locale:自然语言相关的字符串
23662 //strings
23663 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/locale/using.hpp"
23664 //using.hpp
23665 /*
23666 未完成的elc解释器_share文件
23667 由steve02081504与Alex0125设计、编写
23668 转载时请在不对此文件做任何修改的同时注明出处
23669 项目地址:https://github.com/steve02081504/ELC
23670 */
23671 /*
23672 locale说明
23673 elc使用的字符串.
23674 调整这些,实现快速本地化.
23675 */
23676 #line 26 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/locale/using.hpp"
23677
23678 //file_end
23679
23680 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/package_symbol_loader/_body.hpp"
23681 //include paths:获取package_symbol_loader的实际位置
23682 //package_symbol_loader_path
23683 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/paths.hpp"
23684 //paths.hpp
23685 /*
23686 未完成的elc解释器_share文件
23687 由steve02081504与Alex0125设计、编写
23688 转载时请在不对此文件做任何修改的同时注明出处
23689 项目地址:https://github.com/steve02081504/ELC
23690 */
23691 #if !defined(ELC_PATHS)
23692 #define ELC_PATHS
23693 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base_defs"
23694 //base_defs
23695 //at namespace ::
23696 /*
23697 未完成的elc解释器include文件
23698 由steve02081504与Alex0125设计、编写
23699 转载时请在不对此文件做任何修改的同时注明出处
23700 项目地址:https://github.com/steve02081504/ELC
23701 */
23702 #line 22 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base_defs"
23703
23704 //file_end
23705
23706 #line 10 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/paths.hpp"
23707 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/string"
23708 //string
23709 //at namespace ::
23710 /*
23711 未完成的elc解释器include文件
23712 由steve02081504与Alex0125设计、编写
23713 转载时请在不对此文件做任何修改的同时注明出处
23714 项目地址:https://github.com/steve02081504/ELC
23715 */
23716 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/string"
23717
23718 //file_end
23719
23720 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/paths.hpp"
23721 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/str_code_convert.hpp"
23722 //str_code_convert.hpp
23723 /*
23724 未完成的elc解释器_share文件
23725 由steve02081504与Alex0125设计、编写
23726 转载时请在不对此文件做任何修改的同时注明出处
23727 项目地址:https://github.com/steve02081504/ELC
23728 */
23729 /*
23730 APIs说明
23731 elc依赖的基础函数.
23732 调整这些,实现快速移植,快速优化与行为自定义.
23733 */
23734 #line 70 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/str_code_convert.hpp"
23735
23736 //file_end
23737
23738 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/paths.hpp"
23739 //
23740 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/_tools/decl_system_type.hpp"
23741 //decl_system_type.hpp
23742 /*
23743 未完成的elc解释器_share文件
23744 由steve02081504与Alex0125设计、编写
23745 转载时请在不对此文件做任何修改的同时注明出处
23746 项目地址:https://github.com/steve02081504/ELC
23747 */
23748 //copy&rewrite from steve02081504/steve.h
23749 #define linux 2
23750 #define windows 3
23751 #define other 4
23752 #if defined(__linux)||defined(__linux__)||defined(__gnu_linux__)
23753 #define SYSTEM_TYPE linux
23754 #elif defined(_WIN32)||defined(__MINGW32__)||defined(__CYGWIN__)
23755 #define SYSTEM_TYPE windows
23756 #else
23757 #define SYSTEM_TYPE other
23758 #endif
23759 #define ERROR_MSG_UNABLE_OS "Unable OS,edit this file on your own or contact ELC's producers."
23760
23761 //file_end
23762
23763 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/paths.hpp"
23764 //
23765 #if SYSTEM_TYPE == windows
23766 #include <shlobj_core.h>
23767 #elif SYSTEM_TYPE == linux
23768 #include <unistd.h>
23769 #else
23770 #include <cstdio>
23771 #endif
23772 //
23773 namespace elc::paths{
23774 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
23775 //_defs.hpp
23776 /*
23777 未完成的elc解释器_share文件
23778 由steve02081504与Alex0125设计、编写
23779 转载时请在不对此文件做任何修改的同时注明出处
23780 项目地址:https://github.com/steve02081504/ELC
23781 */
23782
23783 //undefs at "_undefs.hpp"
23784
23785 //set ELC_WARNING_LEVEL default to 4(max)
23786 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
23787
23788 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/basic_environment.hpp"
23789 //basic_environment.hpp
23790 /*
23791 未完成的elc解释器_share文件
23792 由steve02081504与Alex0125设计、编写
23793 转载时请在不对此文件做任何修改的同时注明出处
23794 项目地址:https://github.com/steve02081504/ELC
23795 */
23796
23799 #define BIT_POSSIBILITY 2
23800
23801 //file_end
23802
23803 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
23804
23805 #if defined(_MSC_VER)
23806 #pragma warning(push,ELC_WARNING_LEVEL)
23807 #pragma warning(disable:4099)//class与struct混用警告diss
23808 #pragma warning(disable:26812)//enum class安利diss.
23809 #pragma warning(disable:4584)//重复子类警告diss
23810 #pragma warning(disable:4250)//域控制继承警告diss
23811 #pragma warning(disable:26432)//不完全默认方法警告diss
23812 #pragma warning(disable:26435)//virtual override方法警告diss
23813 #pragma warning(disable:26481)//容器安利diss
23814 #pragma warning(disable:26446)//gsl::at安利diss
23815 #pragma warning(disable:26434)//方法覆盖警告diss
23816 #pragma warning(disable:26429)//gsl::not_null安利diss
23817 #pragma warning(disable:26471)//对void*进行static_cast安利diss
23818 #pragma warning(disable:26474)//隐式指针转换显式cast警告diss
23819 #pragma warning(disable:26473)//相同指针显式cast警告diss
23820 #pragma warning(disable:26456)//隐藏非虚运算符警告diss
23821 #pragma warning(disable:26485)//数组作指针警告diss
23822 #pragma warning(disable:26490)//reinterpret_cast警告diss
23823 #pragma warning(disable:26472)//static_cast窄幅转换警告diss
23824 #pragma warning(disable:26482)//非常数数组索引警告diss
23825 #pragma warning(disable:26493)//c_cast转换警告diss:虽然有用但是太烦了,爬
23826 #endif
23827 #if defined(_MSC_VER)
23828 #define suppress_msvc_warning(...) __pragma(warning(suppress:__VA_ARGS__))
23829 #define disable_msvc_warning(...) __pragma(warning(disable:__VA_ARGS__))
23830 #define push_msvc_warning() __pragma(warning(push))
23831 #define pop_msvc_warning() __pragma(warning(pop))
23832 #define push_and_disable_msvc_warning(...) push_msvc_warning() disable_msvc_warning(__VA_ARGS__)
23833 #else
23834 #define suppress_msvc_warning(...)
23835 #define disable_msvc_warning(...)
23836 #define push_msvc_warning()
23837 #define pop_msvc_warning()
23838 #define push_and_disable_msvc_warning(...)
23839 #endif
23840 //
23841 #if defined(ELC_VOID_NAME)
23842 #undef void
23843 #endif
23844
23845 // #define often_noexcept
23846 #define noexcept_as(...) noexcept(noexcept((__VA_ARGS__)))//dnmd C艹标准就是没有noexcept_as_auto
23847 #define noexcept_as_auto MAGIC//哦现在有了
23848 #define constexpr_as(...) MAGIC constexpr//( •̀ ω •́ )✌
23849 #define constexpr_as_auto MAGIC MAGIC constexpr//✌( •̀ ω •́ )✌
23850
23851 #define using_method_from_base_t(name,...) \
23852 template<class...Args> requires was_not_an_ill_form(declvalue(base_t).name(declvalue(Args)...))\
23853 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(base_t::name(declvalue(Args)...))\
23854 {\
23855 return base_t::name(forward<Args>(rest)...);\
23856 }\
23857
23858 #define using_method_from_value(name,value_name,...) \
23859 template<class...Args> requires was_not_an_ill_form(re_declvalue(value_name).name(declvalue(Args)...))\
23860 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(re_declvalue(value_name).name(declvalue(Args)...))\
23861 {\
23862 return value_name.name(forward<Args>(rest)...);\
23863 }\
23864
23865 #define floop while(__builtin_is_my_dick_still_there())
23866 #define enable_adl(name) void name()noexcept=delete
23867
23868 #define re_declvalue(...) (declvalue(decltype(__VA_ARGS__)))
23869 #define re_decltype(...) (decltype(declvalue(__VA_ARGS__)))
23870
23871 #define declvalue(...) (::std::declval<__VA_ARGS__>())
23872
23874 #define template_error(reason) static_assert(template_error_helper<T>,reason)
23876 #define template_warning(reason) template_warning_helper<T>(reason)
23877
23878 //for type_info
23879 #define type_info_of(...) base_type_info_t(typeid(__VA_ARGS__))
23880 #define type_name_of(...) (type_info_of(__VA_ARGS__).name())
23881
23882 #define is_common_attribute(name) public attribute<T,name<T>>
23883 #define is_special_attribute(name) public attribute<T,name>
23884
23885 #define has_attribute(...) template_name has_attribute_helper<__VA_ARGS__>()
23886 #define not_has_attribute(...) template_name not_has_has_attribute_helper<__VA_ARGS__>()
23887
23888 //for float_size_t
23889 #define float_size_of(...) (float_size_t{sizeof(__VA_ARGS__)})
23890 //bitnum_of
23891 #define bitnum_of(...) (bitnumof<__VA_ARGS__>)
23892
23893 //for attribute
23894 #define def_common_attribute_with_nothing(name) \
23895 template<typename T>\
23896 class name{}\
23897
23898 #define def_special_attribute_with_nothing(name) \
23899 class name{}\
23900
23901 #define common_attribute_t template<class>class
23902 #define special_attribute_t class
23903
23912 #define enable_if(...) class enable_state= ::std::enable_if_t<__VA_ARGS__>
23914 #define enabled_by_default class enable_state=void
23916 #define disabled_by_default class enable_state= ::std::enable_if_t<false>
23918 #define enable_if_not_ill_form(...) class enable_state= ::std::void_t<decltype(__VA_ARGS__)>
23920 #define enable_flag class enable_state
23921
23922 #define was_an_ill_form(...) (!was_not_an_ill_form(__VA_ARGS__))
23923 #define was_an_ill_form_with_parameter(...) (!was_not_an_ill_form_with_parameter(__VA_ARGS__))
23924 #define was_not_an_ill_form(...) (bool(requires{__VA_ARGS__;}))
23925 #define was_not_an_ill_form_and_noexcept(...) (bool(requires{__VA_ARGS__;{__VA_ARGS__}noexcept;}))
23926 #define was_not_an_ill_form_with_parameter(...) (bool(requires __VA_ARGS__ ))
23927
23929 #define recursive_lambda(...) lambda(auto&&lambda_RLSRRS,__VA_ARGS__)
23931 #define get_recursive_lambda_caller(name) \
23932 lambda_with_catch(&)(auto&&...Args){\
23933 return name(name,Args...);\
23934 }
23936 #define lambda []
23938 #define lambda_with_catch(...) [__VA_ARGS__]
23940 #define self_recursion(...) lambda_RLSRRS(lambda_RLSRRS,__VA_ARGS__)
23941 //recursive_lambda_self_referential_reserved_symbolname
23942 #define lambda_RLSRRS _my_jb_super_sb_name_
23943
23944 #define MAGIC//ahh,ko no tenno da!
23945
23947 #define nothing
23948
23950 #define elseif else if
23952 #define _big_than_ >
23954 #define _small_than_ <
23955
23956 #if defined(_MSC_VER)
23957 #define not !
23958 #define and &&
23959 #define or ||
23960 #endif
23961
23963 #define INTER_NAMESPACE(NAMESPACENAME) namespace NAMESPACENAME{
23965 #define BREAK_NAMESPACE }
23966
23968 #define template_name template
23970 #define type_name class
23971
23972 #if defined(DEBUG) || defined(_DEBUG)
23973 #define not_in_debug 0
23974 #else
23975 #define not_in_debug 1
23976 #endif
23977
23978 #define es U""
23979 #define ec(ch) U ## ch
23980
23981 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
23982 #define ELC_TEST_EVENTNAME(name) stest_eventer _the_stest_eventer__(L""name)
23983 #else
23984 #define ELC_TEST_EVENTNAME(name)
23985 #endif
23986
23987 #define override_instance_struct \
23988 protected:\
23989 virtual void abstract_method_unget_this()noexcept_as(instance_struct<this_t>::abstract_method_unget_this())override{instance_struct<this_t>::abstract_method_unget_this();}\
23990 virtual void* _abstract_method_copy_get_this()noexcept_as(instance_struct<this_t>::_abstract_method_copy_get_this())override{return instance_struct<this_t>::_abstract_method_copy_get_this();}\
23991 virtual void* _abstract_method_get_resize_this(size_t size)noexcept_as(instance_struct<this_t>::instance_struct<this_t>::_abstract_method_get_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_resize_this(size);}\
23992 virtual void* _abstract_method_get_forward_resize_this(size_t size)noexcept_as(instance_struct<this_t>::_abstract_method_get_forward_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_forward_resize_this(size);}\
23993 virtual size_t abstract_method_get_size_of_get_for_this()noexcept override{return instance_struct<this_t>::abstract_method_get_size_of_get_for_this();}
23994
23995 #if defined(_WIN32)
23996 #define distinctive __declspec(dllexport)
23997 #else
23998 #define distinctive
23999 #endif
24000
24001 #if defined(_WIN32)
24002 #define force_inline __forceinline
24003 #elif defined(__GNUC__)
24004 #define force_inline __attribute__((always_inline)) inline
24005 #else
24006 #define force_inline inline
24007 #endif
24008
24009 #if defined(_WIN32)
24010 #define with_no_vtable __declspec(novtable)
24011 #else
24012 #define with_no_vtable
24013 #endif
24014
24015 #define in_consteval (::std::is_constant_evaluated())
24016
24017 #define no_vtable_struct struct with_no_vtable
24018 #define no_vtable_class class with_no_vtable
24019
24020 //file_end
24021
24022 #line 25 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/paths.hpp"
24023
24024 using namespace ::elc::defs;
24025 namespace defs{
24026 #if SYSTEM_TYPE == windows
24027 #define DYNAMIC_LIBRARY_SUFFIX ".dll"
24028 #else
24029 #define DYNAMIC_LIBRARY_SUFFIX ".so"
24030 #endif
24031
24032 [[nodiscard]]inline bool file_exists(const string&name)noexcept{
24033 #if SYSTEM_TYPE == windows
24034 return GetFileAttributesA(to_char_str(name).c_str())!=INVALID_FILE_ATTRIBUTES;
24035 #elif SYSTEM_TYPE == linux
24036 return access(to_char_str(name).c_str(),F_OK)==0;
24037 #else
24038 auto fp = ::std::fopen(to_char_str(name).c_str(), "rb");
24039 if(fp){
24040 ::std::fclose(fp);
24041 return true;
24042 }
24043 return false;
24044 #endif
24045 }
24046 [[nodiscard]]inline string get_program_data_path()noexcept{
24047 #if SYSTEM_TYPE == windows
24048 char path[MAX_PATH];
24049 if(!SUCCEEDED(SHGetFolderPathA(NULL, CSIDL_COMMON_APPDATA, NULL, 0, path)))
24050 return string{};
24051 return to_char_t_str(path);
24052 #elif SYSTEM_TYPE == linux
24053 return es"/usr/local/share"_constexpr_str;
24054 #else
24055 return string{};
24056 #endif
24057 }
24058 [[nodiscard]]inline string get_system_drive()noexcept{
24059 #if SYSTEM_TYPE == windows
24060 char path[MAX_PATH];
24061 if(!SUCCEEDED(SHGetFolderPathA(NULL, CSIDL_WINDOWS, NULL, 0, path)))
24062 return string{};
24063 return to_char_t_str(path)+es"\\.."_constexpr_str;
24064 #elif SYSTEM_TYPE == linux
24065 return es"/"_constexpr_str;
24066 #else
24067 return string{};
24068 #endif
24069 }
24070 [[nodiscard]]inline string get_elc_runtime_lib_path()noexcept{
24071 #if SYSTEM_TYPE == windows
24072 //windows: if can read file ProgramData/elc/flag , use ProgramData/elc
24073 //else try to read SystemDrive/elc/flag , use ProgramData/elc
24074 //else return "./elc"
24075 {
24076 string program_data_path=get_program_data_path();
24077 if(program_data_path.size() && file_exists(program_data_path + es"/elc/flag"_constexpr_str))
24078 return program_data_path+es"/elc"_constexpr_str;
24079 }
24080 {
24081 string system_drive=get_system_drive();
24082 if(system_drive.size() && file_exists(system_drive + es"/elc/flag"_constexpr_str))
24083 return system_drive+es"/elc"_constexpr_str;
24084 }
24085 #elif SYSTEM_TYPE == linux
24086 //linux: if can read file /usr/lib/elc/flag , use /usr/lib/elc
24087 //else return "./elc"
24088 string flag_path=es"/usr/lib/elc/flag"_constexpr_str;
24089 if(file_exists(flag_path))
24090 return es"/usr/lib/elc"_constexpr_str;
24091 #endif
24092 return es"./elc"_constexpr_str;
24093 }
24094 }
24095 inline constexpr auto package_symbol_loader_file_name = es"package_symbol_loader" DYNAMIC_LIBRARY_SUFFIX ""_constexpr_str;
24096
24097 push_and_disable_msvc_warning(26426);//动态初始化警告diss
24098 distinctive inline string elc_runtime_lib_path=defs::get_elc_runtime_lib_path();
24101
24102 #undef DYNAMIC_LIBRARY_SUFFIX
24103
24104 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_undefs.hpp"
24105 //_undefs.hpp
24106 /*
24107 未完成的elc解释器_share文件
24108 由steve02081504与Alex0125设计、编写
24109 转载时请在不对此文件做任何修改的同时注明出处
24110 项目地址:https://github.com/steve02081504/ELC
24111 */
24112
24113 //defs at "_defs.hpp"
24114
24115 #if defined(_MSC_VER)
24116 #pragma warning(pop)
24117 #endif
24118 #undef suppress_msvc_warning
24119 #undef disable_msvc_warning
24120 #undef push_msvc_warning
24121 #undef pop_msvc_warning
24122 #undef push_and_disable_msvc_warning
24123
24124 //for basic_environment.hpp
24125 #undef BIT_POSSIBILITY
24126 //
24127 #if defined(ELC_VOID_NAME)
24128 #define void the_void
24129 #endif
24130
24131 // #undef often_noexcept
24132 #undef noexcept_as
24133 #undef noexcept_as_auto
24134 #undef constexpr_as
24135 #undef constexpr_as_auto
24136
24137 #undef using_method_from_base_t
24138 #undef using_method_from_value
24139
24140 #undef floop
24141 #undef enable_adl
24142
24143 #undef re_declvalue
24144 #undef re_decltype
24145
24146 #undef declvalue
24147
24148 #undef template_error
24149 #undef template_warning
24150
24151 #undef type_info_of
24152 #undef type_name_of
24153
24154 #undef is_common_attribute
24155 #undef is_special_attribute
24156
24157 #undef has_attribute
24158 #undef not_has_attribute
24159
24160 #undef float_size_of
24161 #undef bitnum_of
24162
24163 #undef def_common_attribute_with_nothing
24164 #undef def_special_attribute_with_nothing
24165
24166 #undef common_attribute_t
24167 #undef special_attribute_t
24168
24169 #undef enable_if
24170 #undef enabled_by_default
24171 #undef disabled_by_default
24172 #undef enable_if_not_ill_form
24173 #undef enable_flag
24174
24175 #undef was_an_ill_form
24176 #undef was_an_ill_form_with_parameter
24177 #undef was_not_an_ill_form
24178 #undef was_not_an_ill_form_and_noexcept
24179 #undef was_not_an_ill_form_with_parameter
24180
24181 #undef recursive_lambda
24182 #undef get_recursive_lambda_caller
24183 #undef lambda
24184 #undef lambda_with_catch
24185 #undef self_recursion
24186 #undef lambda_RLSRRS
24187
24188 #undef MAGIC
24189
24190 #undef nothing
24191
24192 #undef elseif
24193 #undef _big_than_
24194 #undef _small_than_
24195
24196 #if defined(_MSC_VER)
24197 #undef not
24198 #undef and
24199 #undef or
24200 #endif
24201
24202 #undef INTER_NAMESPACE
24203 #undef BREAK_NAMESPACE
24204
24205 #undef szie
24206 #undef form
24207
24208 #undef template_name
24209 #undef type_name
24210
24211 #undef not_in_debug
24212
24213 #undef es
24214 #undef ec
24215
24216 #undef ELC_TEST_EVENTNAME
24217
24218 #undef override_instance_struct
24219
24220 #undef distinctive
24221
24222 #undef force_inline
24223
24224 #undef with_no_vtable
24225
24226 #undef in_consteval
24227
24228 #undef no_vtable_struct
24229 #undef no_vtable_class
24230
24231 //file_end
24232
24233 #line 107 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/paths.hpp"
24234 }
24235 //
24236 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/_tools/undef_decl_system_type.hpp"
24237 //undef_decl_system_type.hpp
24238 /*
24239 未完成的elc解释器_share文件
24240 由steve02081504与Alex0125设计、编写
24241 转载时请在不对此文件做任何修改的同时注明出处
24242 项目地址:https://github.com/steve02081504/ELC
24243 */
24244 //copy&rewrite from steve02081504/evest.h
24245 #undef linux
24246 #undef windows
24247 #undef other
24248 #undef SYSTEM_TYPE
24249 #undef ERROR_MSG_UNABLE_OS
24250
24251 //file_end
24252
24253 #line 110 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/paths.hpp"
24254 #endif
24255
24256 //file_end
24257
24258 #line 15 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/package_symbol_loader/_body.hpp"
24259 namespace elc::defs{
24260 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
24261 //_defs.hpp
24262 /*
24263 未完成的elc解释器basic文件
24264 由steve02081504与Alex0125设计、编写
24265 转载时请在不对此文件做任何修改的同时注明出处
24266 项目地址:https://github.com/steve02081504/ELC
24267 */
24268 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
24269 //_defs.hpp
24270 /*
24271 未完成的elc解释器_share文件
24272 由steve02081504与Alex0125设计、编写
24273 转载时请在不对此文件做任何修改的同时注明出处
24274 项目地址:https://github.com/steve02081504/ELC
24275 */
24276
24277 //undefs at "_undefs.hpp"
24278
24279 //set ELC_WARNING_LEVEL default to 4(max)
24280 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
24281
24282 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/basic_environment.hpp"
24283 //basic_environment.hpp
24284 /*
24285 未完成的elc解释器_share文件
24286 由steve02081504与Alex0125设计、编写
24287 转载时请在不对此文件做任何修改的同时注明出处
24288 项目地址:https://github.com/steve02081504/ELC
24289 */
24290
24293 #define BIT_POSSIBILITY 2
24294
24295 //file_end
24296
24297 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
24298
24299 #if defined(_MSC_VER)
24300 #pragma warning(push,ELC_WARNING_LEVEL)
24301 #pragma warning(disable:4099)//class与struct混用警告diss
24302 #pragma warning(disable:26812)//enum class安利diss.
24303 #pragma warning(disable:4584)//重复子类警告diss
24304 #pragma warning(disable:4250)//域控制继承警告diss
24305 #pragma warning(disable:26432)//不完全默认方法警告diss
24306 #pragma warning(disable:26435)//virtual override方法警告diss
24307 #pragma warning(disable:26481)//容器安利diss
24308 #pragma warning(disable:26446)//gsl::at安利diss
24309 #pragma warning(disable:26434)//方法覆盖警告diss
24310 #pragma warning(disable:26429)//gsl::not_null安利diss
24311 #pragma warning(disable:26471)//对void*进行static_cast安利diss
24312 #pragma warning(disable:26474)//隐式指针转换显式cast警告diss
24313 #pragma warning(disable:26473)//相同指针显式cast警告diss
24314 #pragma warning(disable:26456)//隐藏非虚运算符警告diss
24315 #pragma warning(disable:26485)//数组作指针警告diss
24316 #pragma warning(disable:26490)//reinterpret_cast警告diss
24317 #pragma warning(disable:26472)//static_cast窄幅转换警告diss
24318 #pragma warning(disable:26482)//非常数数组索引警告diss
24319 #pragma warning(disable:26493)//c_cast转换警告diss:虽然有用但是太烦了,爬
24320 #endif
24321 #if defined(_MSC_VER)
24322 #define suppress_msvc_warning(...) __pragma(warning(suppress:__VA_ARGS__))
24323 #define disable_msvc_warning(...) __pragma(warning(disable:__VA_ARGS__))
24324 #define push_msvc_warning() __pragma(warning(push))
24325 #define pop_msvc_warning() __pragma(warning(pop))
24326 #define push_and_disable_msvc_warning(...) push_msvc_warning() disable_msvc_warning(__VA_ARGS__)
24327 #else
24328 #define suppress_msvc_warning(...)
24329 #define disable_msvc_warning(...)
24330 #define push_msvc_warning()
24331 #define pop_msvc_warning()
24332 #define push_and_disable_msvc_warning(...)
24333 #endif
24334 //
24335 #if defined(ELC_VOID_NAME)
24336 #undef void
24337 #endif
24338
24339 // #define often_noexcept
24340 #define noexcept_as(...) noexcept(noexcept((__VA_ARGS__)))//dnmd C艹标准就是没有noexcept_as_auto
24341 #define noexcept_as_auto MAGIC//哦现在有了
24342 #define constexpr_as(...) MAGIC constexpr//( •̀ ω •́ )✌
24343 #define constexpr_as_auto MAGIC MAGIC constexpr//✌( •̀ ω •́ )✌
24344
24345 #define using_method_from_base_t(name,...) \
24346 template<class...Args> requires was_not_an_ill_form(declvalue(base_t).name(declvalue(Args)...))\
24347 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(base_t::name(declvalue(Args)...))\
24348 {\
24349 return base_t::name(forward<Args>(rest)...);\
24350 }\
24351
24352 #define using_method_from_value(name,value_name,...) \
24353 template<class...Args> requires was_not_an_ill_form(re_declvalue(value_name).name(declvalue(Args)...))\
24354 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(re_declvalue(value_name).name(declvalue(Args)...))\
24355 {\
24356 return value_name.name(forward<Args>(rest)...);\
24357 }\
24358
24359 #define floop while(__builtin_is_my_dick_still_there())
24360 #define enable_adl(name) void name()noexcept=delete
24361
24362 #define re_declvalue(...) (declvalue(decltype(__VA_ARGS__)))
24363 #define re_decltype(...) (decltype(declvalue(__VA_ARGS__)))
24364
24365 #define declvalue(...) (::std::declval<__VA_ARGS__>())
24366
24368 #define template_error(reason) static_assert(template_error_helper<T>,reason)
24370 #define template_warning(reason) template_warning_helper<T>(reason)
24371
24372 //for type_info
24373 #define type_info_of(...) base_type_info_t(typeid(__VA_ARGS__))
24374 #define type_name_of(...) (type_info_of(__VA_ARGS__).name())
24375
24376 #define is_common_attribute(name) public attribute<T,name<T>>
24377 #define is_special_attribute(name) public attribute<T,name>
24378
24379 #define has_attribute(...) template_name has_attribute_helper<__VA_ARGS__>()
24380 #define not_has_attribute(...) template_name not_has_has_attribute_helper<__VA_ARGS__>()
24381
24382 //for float_size_t
24383 #define float_size_of(...) (float_size_t{sizeof(__VA_ARGS__)})
24384 //bitnum_of
24385 #define bitnum_of(...) (bitnumof<__VA_ARGS__>)
24386
24387 //for attribute
24388 #define def_common_attribute_with_nothing(name) \
24389 template<typename T>\
24390 class name{}\
24391
24392 #define def_special_attribute_with_nothing(name) \
24393 class name{}\
24394
24395 #define common_attribute_t template<class>class
24396 #define special_attribute_t class
24397
24406 #define enable_if(...) class enable_state= ::std::enable_if_t<__VA_ARGS__>
24408 #define enabled_by_default class enable_state=void
24410 #define disabled_by_default class enable_state= ::std::enable_if_t<false>
24412 #define enable_if_not_ill_form(...) class enable_state= ::std::void_t<decltype(__VA_ARGS__)>
24414 #define enable_flag class enable_state
24415
24416 #define was_an_ill_form(...) (!was_not_an_ill_form(__VA_ARGS__))
24417 #define was_an_ill_form_with_parameter(...) (!was_not_an_ill_form_with_parameter(__VA_ARGS__))
24418 #define was_not_an_ill_form(...) (bool(requires{__VA_ARGS__;}))
24419 #define was_not_an_ill_form_and_noexcept(...) (bool(requires{__VA_ARGS__;{__VA_ARGS__}noexcept;}))
24420 #define was_not_an_ill_form_with_parameter(...) (bool(requires __VA_ARGS__ ))
24421
24423 #define recursive_lambda(...) lambda(auto&&lambda_RLSRRS,__VA_ARGS__)
24425 #define get_recursive_lambda_caller(name) \
24426 lambda_with_catch(&)(auto&&...Args){\
24427 return name(name,Args...);\
24428 }
24430 #define lambda []
24432 #define lambda_with_catch(...) [__VA_ARGS__]
24434 #define self_recursion(...) lambda_RLSRRS(lambda_RLSRRS,__VA_ARGS__)
24435 //recursive_lambda_self_referential_reserved_symbolname
24436 #define lambda_RLSRRS _my_jb_super_sb_name_
24437
24438 #define MAGIC//ahh,ko no tenno da!
24439
24441 #define nothing
24442
24444 #define elseif else if
24446 #define _big_than_ >
24448 #define _small_than_ <
24449
24450 #if defined(_MSC_VER)
24451 #define not !
24452 #define and &&
24453 #define or ||
24454 #endif
24455
24457 #define INTER_NAMESPACE(NAMESPACENAME) namespace NAMESPACENAME{
24459 #define BREAK_NAMESPACE }
24460
24462 #define template_name template
24464 #define type_name class
24465
24466 #if defined(DEBUG) || defined(_DEBUG)
24467 #define not_in_debug 0
24468 #else
24469 #define not_in_debug 1
24470 #endif
24471
24472 #define es U""
24473 #define ec(ch) U ## ch
24474
24475 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
24476 #define ELC_TEST_EVENTNAME(name) stest_eventer _the_stest_eventer__(L""name)
24477 #else
24478 #define ELC_TEST_EVENTNAME(name)
24479 #endif
24480
24481 #define override_instance_struct \
24482 protected:\
24483 virtual void abstract_method_unget_this()noexcept_as(instance_struct<this_t>::abstract_method_unget_this())override{instance_struct<this_t>::abstract_method_unget_this();}\
24484 virtual void* _abstract_method_copy_get_this()noexcept_as(instance_struct<this_t>::_abstract_method_copy_get_this())override{return instance_struct<this_t>::_abstract_method_copy_get_this();}\
24485 virtual void* _abstract_method_get_resize_this(size_t size)noexcept_as(instance_struct<this_t>::instance_struct<this_t>::_abstract_method_get_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_resize_this(size);}\
24486 virtual void* _abstract_method_get_forward_resize_this(size_t size)noexcept_as(instance_struct<this_t>::_abstract_method_get_forward_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_forward_resize_this(size);}\
24487 virtual size_t abstract_method_get_size_of_get_for_this()noexcept override{return instance_struct<this_t>::abstract_method_get_size_of_get_for_this();}
24488
24489 #if defined(_WIN32)
24490 #define distinctive __declspec(dllexport)
24491 #else
24492 #define distinctive
24493 #endif
24494
24495 #if defined(_WIN32)
24496 #define force_inline __forceinline
24497 #elif defined(__GNUC__)
24498 #define force_inline __attribute__((always_inline)) inline
24499 #else
24500 #define force_inline inline
24501 #endif
24502
24503 #if defined(_WIN32)
24504 #define with_no_vtable __declspec(novtable)
24505 #else
24506 #define with_no_vtable
24507 #endif
24508
24509 #define in_consteval (::std::is_constant_evaluated())
24510
24511 #define no_vtable_struct struct with_no_vtable
24512 #define no_vtable_class class with_no_vtable
24513
24514 //file_end
24515
24516 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
24517
24518 //file_end
24519
24520 #line 17 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/package_symbol_loader/_body.hpp"
24521
24522 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/package_symbol_loader/package_symbol_loader.hpp"
24523 //package_symbol_loader.hpp
24524 /*
24525 未完成的elc解释器template文件
24526 由steve02081504与Alex0125设计、编写
24527 转载时请在不对此文件做任何修改的同时注明出处
24528 项目地址:https://github.com/steve02081504/ELC
24529 */
24530 namespace package_symbol_loader_n{
24533 function_t<ptr(string lib_name, size_t lib_ver, string symbol_name)noexcept> load_interface;
24534 function_t<ptr()noexcept> load_error_interface;
24535
24537 if(package_symbol_loader_handle = load_lib(paths::package_symbol_loader_path)){
24538 load_interface = package_symbol_loader_handle->get_symbol_as_function<ptr(string lib_name,size_t lib_ver,string symbol_name)noexcept>(es"load_interface");
24539 load_error_interface = package_symbol_loader_handle->get_symbol_as_function<ptr()noexcept>(es"load_error_interface");
24540 }
24541 else
24542 die_with(locale::str::package_symbol_loader::load_failed);
24543 if(!load_interface)
24544 die_with(locale::str::package_symbol_loader::load_interface_failed);
24545 }
24546 ~package_symbol_loader_t()noexcept = default;
24547
24548 ptr load_symbol(string lib_name,size_t lib_ver,string symbol_name)noexcept{
24549 return load_interface(lib_name,lib_ver,symbol_name);
24550 }
24551 ptr get_load_error()noexcept{
24552 return load_error_interface();
24553 }
24554 };
24555 }
24556
24557 //file_end
24558 #line 19 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/package_symbol_loader/_body.hpp"
24559 #if defined(ELC_TEST_ON)
24560 namespace package_symbol_loader_part_test{
24561 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/package_symbol_loader/_test.hpp"
24562 //_test.hpp
24563 /*
24564 未完成的elc解释器template文件
24565 由steve02081504与Alex0125设计、编写
24566 转载时请在不对此文件做任何修改的同时注明出处
24567 项目地址:https://github.com/steve02081504/ELC
24568 */
24569 inline void test(){
24570 ELC_TEST_EVENTNAME("package_symbol_loader部分测试");
24571 }
24572 inline void test_log_out(){}
24573 inline void test_end{}
24574
24575 //file_end
24576
24577 #line 22 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/package_symbol_loader/_body.hpp"
24578 }
24579 #endif
24580
24581 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
24582 //_undefs.hpp
24583 /*
24584 未完成的elc解释器basic文件
24585 由steve02081504与Alex0125设计、编写
24586 转载时请在不对此文件做任何修改的同时注明出处
24587 项目地址:https://github.com/steve02081504/ELC
24588 */
24589 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_undefs.hpp"
24590 //_undefs.hpp
24591 /*
24592 未完成的elc解释器_share文件
24593 由steve02081504与Alex0125设计、编写
24594 转载时请在不对此文件做任何修改的同时注明出处
24595 项目地址:https://github.com/steve02081504/ELC
24596 */
24597
24598 //defs at "_defs.hpp"
24599
24600 #if defined(_MSC_VER)
24601 #pragma warning(pop)
24602 #endif
24603 #undef suppress_msvc_warning
24604 #undef disable_msvc_warning
24605 #undef push_msvc_warning
24606 #undef pop_msvc_warning
24607 #undef push_and_disable_msvc_warning
24608
24609 //for basic_environment.hpp
24610 #undef BIT_POSSIBILITY
24611 //
24612 #if defined(ELC_VOID_NAME)
24613 #define void the_void
24614 #endif
24615
24616 // #undef often_noexcept
24617 #undef noexcept_as
24618 #undef noexcept_as_auto
24619 #undef constexpr_as
24620 #undef constexpr_as_auto
24621
24622 #undef using_method_from_base_t
24623 #undef using_method_from_value
24624
24625 #undef floop
24626 #undef enable_adl
24627
24628 #undef re_declvalue
24629 #undef re_decltype
24630
24631 #undef declvalue
24632
24633 #undef template_error
24634 #undef template_warning
24635
24636 #undef type_info_of
24637 #undef type_name_of
24638
24639 #undef is_common_attribute
24640 #undef is_special_attribute
24641
24642 #undef has_attribute
24643 #undef not_has_attribute
24644
24645 #undef float_size_of
24646 #undef bitnum_of
24647
24648 #undef def_common_attribute_with_nothing
24649 #undef def_special_attribute_with_nothing
24650
24651 #undef common_attribute_t
24652 #undef special_attribute_t
24653
24654 #undef enable_if
24655 #undef enabled_by_default
24656 #undef disabled_by_default
24657 #undef enable_if_not_ill_form
24658 #undef enable_flag
24659
24660 #undef was_an_ill_form
24661 #undef was_an_ill_form_with_parameter
24662 #undef was_not_an_ill_form
24663 #undef was_not_an_ill_form_and_noexcept
24664 #undef was_not_an_ill_form_with_parameter
24665
24666 #undef recursive_lambda
24667 #undef get_recursive_lambda_caller
24668 #undef lambda
24669 #undef lambda_with_catch
24670 #undef self_recursion
24671 #undef lambda_RLSRRS
24672
24673 #undef MAGIC
24674
24675 #undef nothing
24676
24677 #undef elseif
24678 #undef _big_than_
24679 #undef _small_than_
24680
24681 #if defined(_MSC_VER)
24682 #undef not
24683 #undef and
24684 #undef or
24685 #endif
24686
24687 #undef INTER_NAMESPACE
24688 #undef BREAK_NAMESPACE
24689
24690 #undef szie
24691 #undef form
24692
24693 #undef template_name
24694 #undef type_name
24695
24696 #undef not_in_debug
24697
24698 #undef es
24699 #undef ec
24700
24701 #undef ELC_TEST_EVENTNAME
24702
24703 #undef override_instance_struct
24704
24705 #undef distinctive
24706
24707 #undef force_inline
24708
24709 #undef with_no_vtable
24710
24711 #undef in_consteval
24712
24713 #undef no_vtable_struct
24714 #undef no_vtable_class
24715
24716 //file_end
24717
24718 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
24719
24720 //file_end
24721
24722 #line 26 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/package_symbol_loader/_body.hpp"
24723 }
24724 namespace elc{
24725 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/package_symbol_loader/_export.hpp"
24726 //_export.hpp
24727 //at namespace elc
24728 /*
24729 未完成的elc解释器template文件
24730 由steve02081504与Alex0125设计、编写
24731 转载时请在不对此文件做任何修改的同时注明出处
24732 项目地址:https://github.com/steve02081504/ELC
24733 */
24734 #define export using defs::package_symbol_loader_n::
24735
24736 #undef export
24737
24738 //file_end
24739
24740 #line 29 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/package_symbol_loader/_body.hpp"
24741 }
24742
24743 //file_end
24744
24745 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/package_symbol_loader"
24746 #endif
24747
24748 //file_end
24749
24750 #line 23 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/all"
24751 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/stream"
24752 //stream
24753 //at namespace ::
24754 /*
24755 未完成的elc解释器include文件
24756 由steve02081504与Alex0125设计、编写
24757 转载时请在不对此文件做任何修改的同时注明出处
24758 项目地址:https://github.com/steve02081504/ELC
24759 */
24760 #if !defined(ELC_STREAM)
24761 #define ELC_STREAM
24762 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base"
24763 //base
24764 //at namespace ::
24765 /*
24766 未完成的elc解释器include文件
24767 由steve02081504与Alex0125设计、编写
24768 转载时请在不对此文件做任何修改的同时注明出处
24769 项目地址:https://github.com/steve02081504/ELC
24770 */
24771 #line 18 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base"
24772
24773 //file_end
24774
24775 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/stream"
24776 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/stream/_body.hpp"
24777 //_body.hpp
24778 //at namespace ::
24779 /*
24780 未完成的elc解释器stream文件
24781 由steve02081504与Alex0125设计、编写
24782 转载时请在不对此文件做任何修改的同时注明出处
24783 项目地址:https://github.com/steve02081504/ELC
24784 */
24785 #if defined(ELC_TEST)
24786 #error "this part cannot be tested."
24787 #endif
24788 namespace elc::defs{
24789 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
24790 //_defs.hpp
24791 /*
24792 未完成的elc解释器basic文件
24793 由steve02081504与Alex0125设计、编写
24794 转载时请在不对此文件做任何修改的同时注明出处
24795 项目地址:https://github.com/steve02081504/ELC
24796 */
24797 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
24798 //_defs.hpp
24799 /*
24800 未完成的elc解释器_share文件
24801 由steve02081504与Alex0125设计、编写
24802 转载时请在不对此文件做任何修改的同时注明出处
24803 项目地址:https://github.com/steve02081504/ELC
24804 */
24805
24806 //undefs at "_undefs.hpp"
24807
24808 //set ELC_WARNING_LEVEL default to 4(max)
24809 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
24810
24811 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/basic_environment.hpp"
24812 //basic_environment.hpp
24813 /*
24814 未完成的elc解释器_share文件
24815 由steve02081504与Alex0125设计、编写
24816 转载时请在不对此文件做任何修改的同时注明出处
24817 项目地址:https://github.com/steve02081504/ELC
24818 */
24819
24822 #define BIT_POSSIBILITY 2
24823
24824 //file_end
24825
24826 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
24827
24828 #if defined(_MSC_VER)
24829 #pragma warning(push,ELC_WARNING_LEVEL)
24830 #pragma warning(disable:4099)//class与struct混用警告diss
24831 #pragma warning(disable:26812)//enum class安利diss.
24832 #pragma warning(disable:4584)//重复子类警告diss
24833 #pragma warning(disable:4250)//域控制继承警告diss
24834 #pragma warning(disable:26432)//不完全默认方法警告diss
24835 #pragma warning(disable:26435)//virtual override方法警告diss
24836 #pragma warning(disable:26481)//容器安利diss
24837 #pragma warning(disable:26446)//gsl::at安利diss
24838 #pragma warning(disable:26434)//方法覆盖警告diss
24839 #pragma warning(disable:26429)//gsl::not_null安利diss
24840 #pragma warning(disable:26471)//对void*进行static_cast安利diss
24841 #pragma warning(disable:26474)//隐式指针转换显式cast警告diss
24842 #pragma warning(disable:26473)//相同指针显式cast警告diss
24843 #pragma warning(disable:26456)//隐藏非虚运算符警告diss
24844 #pragma warning(disable:26485)//数组作指针警告diss
24845 #pragma warning(disable:26490)//reinterpret_cast警告diss
24846 #pragma warning(disable:26472)//static_cast窄幅转换警告diss
24847 #pragma warning(disable:26482)//非常数数组索引警告diss
24848 #pragma warning(disable:26493)//c_cast转换警告diss:虽然有用但是太烦了,爬
24849 #endif
24850 #if defined(_MSC_VER)
24851 #define suppress_msvc_warning(...) __pragma(warning(suppress:__VA_ARGS__))
24852 #define disable_msvc_warning(...) __pragma(warning(disable:__VA_ARGS__))
24853 #define push_msvc_warning() __pragma(warning(push))
24854 #define pop_msvc_warning() __pragma(warning(pop))
24855 #define push_and_disable_msvc_warning(...) push_msvc_warning() disable_msvc_warning(__VA_ARGS__)
24856 #else
24857 #define suppress_msvc_warning(...)
24858 #define disable_msvc_warning(...)
24859 #define push_msvc_warning()
24860 #define pop_msvc_warning()
24861 #define push_and_disable_msvc_warning(...)
24862 #endif
24863 //
24864 #if defined(ELC_VOID_NAME)
24865 #undef void
24866 #endif
24867
24868 // #define often_noexcept
24869 #define noexcept_as(...) noexcept(noexcept((__VA_ARGS__)))//dnmd C艹标准就是没有noexcept_as_auto
24870 #define noexcept_as_auto MAGIC//哦现在有了
24871 #define constexpr_as(...) MAGIC constexpr//( •̀ ω •́ )✌
24872 #define constexpr_as_auto MAGIC MAGIC constexpr//✌( •̀ ω •́ )✌
24873
24874 #define using_method_from_base_t(name,...) \
24875 template<class...Args> requires was_not_an_ill_form(declvalue(base_t).name(declvalue(Args)...))\
24876 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(base_t::name(declvalue(Args)...))\
24877 {\
24878 return base_t::name(forward<Args>(rest)...);\
24879 }\
24880
24881 #define using_method_from_value(name,value_name,...) \
24882 template<class...Args> requires was_not_an_ill_form(re_declvalue(value_name).name(declvalue(Args)...))\
24883 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(re_declvalue(value_name).name(declvalue(Args)...))\
24884 {\
24885 return value_name.name(forward<Args>(rest)...);\
24886 }\
24887
24888 #define floop while(__builtin_is_my_dick_still_there())
24889 #define enable_adl(name) void name()noexcept=delete
24890
24891 #define re_declvalue(...) (declvalue(decltype(__VA_ARGS__)))
24892 #define re_decltype(...) (decltype(declvalue(__VA_ARGS__)))
24893
24894 #define declvalue(...) (::std::declval<__VA_ARGS__>())
24895
24897 #define template_error(reason) static_assert(template_error_helper<T>,reason)
24899 #define template_warning(reason) template_warning_helper<T>(reason)
24900
24901 //for type_info
24902 #define type_info_of(...) base_type_info_t(typeid(__VA_ARGS__))
24903 #define type_name_of(...) (type_info_of(__VA_ARGS__).name())
24904
24905 #define is_common_attribute(name) public attribute<T,name<T>>
24906 #define is_special_attribute(name) public attribute<T,name>
24907
24908 #define has_attribute(...) template_name has_attribute_helper<__VA_ARGS__>()
24909 #define not_has_attribute(...) template_name not_has_has_attribute_helper<__VA_ARGS__>()
24910
24911 //for float_size_t
24912 #define float_size_of(...) (float_size_t{sizeof(__VA_ARGS__)})
24913 //bitnum_of
24914 #define bitnum_of(...) (bitnumof<__VA_ARGS__>)
24915
24916 //for attribute
24917 #define def_common_attribute_with_nothing(name) \
24918 template<typename T>\
24919 class name{}\
24920
24921 #define def_special_attribute_with_nothing(name) \
24922 class name{}\
24923
24924 #define common_attribute_t template<class>class
24925 #define special_attribute_t class
24926
24935 #define enable_if(...) class enable_state= ::std::enable_if_t<__VA_ARGS__>
24937 #define enabled_by_default class enable_state=void
24939 #define disabled_by_default class enable_state= ::std::enable_if_t<false>
24941 #define enable_if_not_ill_form(...) class enable_state= ::std::void_t<decltype(__VA_ARGS__)>
24943 #define enable_flag class enable_state
24944
24945 #define was_an_ill_form(...) (!was_not_an_ill_form(__VA_ARGS__))
24946 #define was_an_ill_form_with_parameter(...) (!was_not_an_ill_form_with_parameter(__VA_ARGS__))
24947 #define was_not_an_ill_form(...) (bool(requires{__VA_ARGS__;}))
24948 #define was_not_an_ill_form_and_noexcept(...) (bool(requires{__VA_ARGS__;{__VA_ARGS__}noexcept;}))
24949 #define was_not_an_ill_form_with_parameter(...) (bool(requires __VA_ARGS__ ))
24950
24952 #define recursive_lambda(...) lambda(auto&&lambda_RLSRRS,__VA_ARGS__)
24954 #define get_recursive_lambda_caller(name) \
24955 lambda_with_catch(&)(auto&&...Args){\
24956 return name(name,Args...);\
24957 }
24959 #define lambda []
24961 #define lambda_with_catch(...) [__VA_ARGS__]
24963 #define self_recursion(...) lambda_RLSRRS(lambda_RLSRRS,__VA_ARGS__)
24964 //recursive_lambda_self_referential_reserved_symbolname
24965 #define lambda_RLSRRS _my_jb_super_sb_name_
24966
24967 #define MAGIC//ahh,ko no tenno da!
24968
24970 #define nothing
24971
24973 #define elseif else if
24975 #define _big_than_ >
24977 #define _small_than_ <
24978
24979 #if defined(_MSC_VER)
24980 #define not !
24981 #define and &&
24982 #define or ||
24983 #endif
24984
24986 #define INTER_NAMESPACE(NAMESPACENAME) namespace NAMESPACENAME{
24988 #define BREAK_NAMESPACE }
24989
24991 #define template_name template
24993 #define type_name class
24994
24995 #if defined(DEBUG) || defined(_DEBUG)
24996 #define not_in_debug 0
24997 #else
24998 #define not_in_debug 1
24999 #endif
25000
25001 #define es U""
25002 #define ec(ch) U ## ch
25003
25004 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
25005 #define ELC_TEST_EVENTNAME(name) stest_eventer _the_stest_eventer__(L""name)
25006 #else
25007 #define ELC_TEST_EVENTNAME(name)
25008 #endif
25009
25010 #define override_instance_struct \
25011 protected:\
25012 virtual void abstract_method_unget_this()noexcept_as(instance_struct<this_t>::abstract_method_unget_this())override{instance_struct<this_t>::abstract_method_unget_this();}\
25013 virtual void* _abstract_method_copy_get_this()noexcept_as(instance_struct<this_t>::_abstract_method_copy_get_this())override{return instance_struct<this_t>::_abstract_method_copy_get_this();}\
25014 virtual void* _abstract_method_get_resize_this(size_t size)noexcept_as(instance_struct<this_t>::instance_struct<this_t>::_abstract_method_get_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_resize_this(size);}\
25015 virtual void* _abstract_method_get_forward_resize_this(size_t size)noexcept_as(instance_struct<this_t>::_abstract_method_get_forward_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_forward_resize_this(size);}\
25016 virtual size_t abstract_method_get_size_of_get_for_this()noexcept override{return instance_struct<this_t>::abstract_method_get_size_of_get_for_this();}
25017
25018 #if defined(_WIN32)
25019 #define distinctive __declspec(dllexport)
25020 #else
25021 #define distinctive
25022 #endif
25023
25024 #if defined(_WIN32)
25025 #define force_inline __forceinline
25026 #elif defined(__GNUC__)
25027 #define force_inline __attribute__((always_inline)) inline
25028 #else
25029 #define force_inline inline
25030 #endif
25031
25032 #if defined(_WIN32)
25033 #define with_no_vtable __declspec(novtable)
25034 #else
25035 #define with_no_vtable
25036 #endif
25037
25038 #define in_consteval (::std::is_constant_evaluated())
25039
25040 #define no_vtable_struct struct with_no_vtable
25041 #define no_vtable_class class with_no_vtable
25042
25043 //file_end
25044
25045 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
25046
25047 //file_end
25048
25049 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/stream/_body.hpp"
25050
25051 #if defined(ELC_TEST_ON)
25052 namespace stream_part_test{
25053 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/stream/_test.hpp"
25054 //_test.hpp
25055 /*
25056 未完成的elc解释器stream文件
25057 由steve02081504与Alex0125设计、编写
25058 转载时请在不对此文件做任何修改的同时注明出处
25059 项目地址:https://github.com/steve02081504/ELC
25060 */
25061 inline void test(){
25062 ELC_TEST_EVENTNAME("stream部分测试");
25063 }
25064 inline void test_log_out(){
25065 }
25066 inline void test_end{
25067 }
25068
25069 //file_end
25070
25071 #line 17 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/stream/_body.hpp"
25072 }
25073 #endif
25074
25075 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
25076 //_undefs.hpp
25077 /*
25078 未完成的elc解释器basic文件
25079 由steve02081504与Alex0125设计、编写
25080 转载时请在不对此文件做任何修改的同时注明出处
25081 项目地址:https://github.com/steve02081504/ELC
25082 */
25083 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_undefs.hpp"
25084 //_undefs.hpp
25085 /*
25086 未完成的elc解释器_share文件
25087 由steve02081504与Alex0125设计、编写
25088 转载时请在不对此文件做任何修改的同时注明出处
25089 项目地址:https://github.com/steve02081504/ELC
25090 */
25091
25092 //defs at "_defs.hpp"
25093
25094 #if defined(_MSC_VER)
25095 #pragma warning(pop)
25096 #endif
25097 #undef suppress_msvc_warning
25098 #undef disable_msvc_warning
25099 #undef push_msvc_warning
25100 #undef pop_msvc_warning
25101 #undef push_and_disable_msvc_warning
25102
25103 //for basic_environment.hpp
25104 #undef BIT_POSSIBILITY
25105 //
25106 #if defined(ELC_VOID_NAME)
25107 #define void the_void
25108 #endif
25109
25110 // #undef often_noexcept
25111 #undef noexcept_as
25112 #undef noexcept_as_auto
25113 #undef constexpr_as
25114 #undef constexpr_as_auto
25115
25116 #undef using_method_from_base_t
25117 #undef using_method_from_value
25118
25119 #undef floop
25120 #undef enable_adl
25121
25122 #undef re_declvalue
25123 #undef re_decltype
25124
25125 #undef declvalue
25126
25127 #undef template_error
25128 #undef template_warning
25129
25130 #undef type_info_of
25131 #undef type_name_of
25132
25133 #undef is_common_attribute
25134 #undef is_special_attribute
25135
25136 #undef has_attribute
25137 #undef not_has_attribute
25138
25139 #undef float_size_of
25140 #undef bitnum_of
25141
25142 #undef def_common_attribute_with_nothing
25143 #undef def_special_attribute_with_nothing
25144
25145 #undef common_attribute_t
25146 #undef special_attribute_t
25147
25148 #undef enable_if
25149 #undef enabled_by_default
25150 #undef disabled_by_default
25151 #undef enable_if_not_ill_form
25152 #undef enable_flag
25153
25154 #undef was_an_ill_form
25155 #undef was_an_ill_form_with_parameter
25156 #undef was_not_an_ill_form
25157 #undef was_not_an_ill_form_and_noexcept
25158 #undef was_not_an_ill_form_with_parameter
25159
25160 #undef recursive_lambda
25161 #undef get_recursive_lambda_caller
25162 #undef lambda
25163 #undef lambda_with_catch
25164 #undef self_recursion
25165 #undef lambda_RLSRRS
25166
25167 #undef MAGIC
25168
25169 #undef nothing
25170
25171 #undef elseif
25172 #undef _big_than_
25173 #undef _small_than_
25174
25175 #if defined(_MSC_VER)
25176 #undef not
25177 #undef and
25178 #undef or
25179 #endif
25180
25181 #undef INTER_NAMESPACE
25182 #undef BREAK_NAMESPACE
25183
25184 #undef szie
25185 #undef form
25186
25187 #undef template_name
25188 #undef type_name
25189
25190 #undef not_in_debug
25191
25192 #undef es
25193 #undef ec
25194
25195 #undef ELC_TEST_EVENTNAME
25196
25197 #undef override_instance_struct
25198
25199 #undef distinctive
25200
25201 #undef force_inline
25202
25203 #undef with_no_vtable
25204
25205 #undef in_consteval
25206
25207 #undef no_vtable_struct
25208 #undef no_vtable_class
25209
25210 //file_end
25211
25212 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
25213
25214 //file_end
25215
25216 #line 21 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/stream/_body.hpp"
25217 }
25218 namespace elc{
25219 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/stream/_export.hpp"
25220 //_export.hpp
25221 //at namespace elc
25222 /*
25223 未完成的elc解释器stream文件
25224 由steve02081504与Alex0125设计、编写
25225 转载时请在不对此文件做任何修改的同时注明出处
25226 项目地址:https://github.com/steve02081504/ELC
25227 */
25228 #define export using defs::
25229 #undef export
25230
25231 //file_end
25232
25233 #line 24 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/stream/_body.hpp"
25234 }
25235
25236 //file_end
25237
25238 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/stream"
25239 #endif
25240
25241 //file_end
25242
25243 #line 24 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/all"
25244 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/string"
25245 //string
25246 //at namespace ::
25247 /*
25248 未完成的elc解释器include文件
25249 由steve02081504与Alex0125设计、编写
25250 转载时请在不对此文件做任何修改的同时注明出处
25251 项目地址:https://github.com/steve02081504/ELC
25252 */
25253 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/string"
25254
25255 //file_end
25256
25257 #line 25 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/all"
25258 //#include "test"
25259 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/void_name"
25260 //void_name
25261 //at namespace ::
25262 /*
25263 未完成的elc解释器include文件
25264 由steve02081504与Alex0125设计、编写
25265 转载时请在不对此文件做任何修改的同时注明出处
25266 项目地址:https://github.com/steve02081504/ELC
25267 */
25268 #if !defined(ELC_VOID_NAME)
25269 #define ELC_VOID_NAME
25270 typedef void the_void;
25271 #define void the_void
25272 #endif
25273
25274 //file_end
25275
25276 #line 27 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/all"
25277#endif
25278
25279//file_end
25280
#define get_recursive_lambda_caller(name)
Definition: all_defs.cpp:24954
#define void
Definition: all_defs.cpp:25271
#define _small_than_
Definition: all_defs.cpp:24977
#define in_consteval
Definition: all_defs.cpp:25038
#define was_not_an_ill_form(...)
Definition: all_defs.cpp:24947
#define export
Definition: all_defs.cpp:25228
#define special_attribute_t
Definition: all_defs.cpp:24925
#define float_size_of(...)
Definition: all_defs.cpp:24912
#define other
Definition: all_defs.cpp:23751
#define was_not_an_ill_form_and_noexcept(...)
Definition: all_defs.cpp:24948
#define DYNAMIC_LIBRARY_SUFFIX
Definition: all_defs.cpp:24029
#define template_name
Definition: all_defs.cpp:24991
#define INTER_NAMESPACE(NAMESPACENAME)
Definition: all_defs.cpp:24986
#define was_not_an_ill_form_with_parameter(...)
Definition: all_defs.cpp:24949
#define hash
Definition: all_defs.cpp:2133
#define defspecflag(name)
Definition: all_defs.cpp:994
#define bitnum_of(...)
Definition: all_defs.cpp:24914
#define using_method_from_value(name, value_name,...)
Definition: all_defs.cpp:24881
#define ec(ch)
Definition: all_defs.cpp:25002
#define was_an_ill_form(...)
Definition: all_defs.cpp:24945
#define elseif
Definition: all_defs.cpp:24973
#define enable_flag
Definition: all_defs.cpp:24943
#define template_error(reason)
Definition: all_defs.cpp:24897
#define lambda_with_catch(...)
Definition: all_defs.cpp:24961
#define expr
Definition: all_defs.cpp:10371
#define pop_msvc_warning()
Definition: all_defs.cpp:24860
#define es
Definition: all_defs.cpp:25001
#define suppress_msvc_warning(...)
Definition: all_defs.cpp:24857
#define declvalue(...)
Definition: all_defs.cpp:24894
#define push_and_disable_msvc_warning(...)
Definition: all_defs.cpp:24861
#define def_note(name)
Definition: all_defs.cpp:1767
#define ELC_TEST_EVENTNAME(name)
Definition: all_defs.cpp:25007
#define has_attribute(...)
Definition: all_defs.cpp:24908
#define _m
Definition: all_defs.cpp:17254
#define type_name
Definition: all_defs.cpp:24993
#define floop
Definition: all_defs.cpp:24888
#define is_common_attribute(name)
Definition: all_defs.cpp:24905
#define nothing
Definition: all_defs.cpp:24970
#define constexpr_as(...)
Definition: all_defs.cpp:24871
#define template_warning(reason)
Definition: all_defs.cpp:24899
#define recursive_lambda(...)
Definition: all_defs.cpp:24952
#define constexpr_as_auto
Definition: all_defs.cpp:24872
void the_void
Definition: all_defs.cpp:25270
#define BREAK_NAMESPACE
Definition: all_defs.cpp:24988
#define noexcept_as(...)
Definition: all_defs.cpp:24869
#define no_vtable_class
Definition: all_defs.cpp:25041
#define override_instance_struct
Definition: all_defs.cpp:25010
#define lambda
Definition: all_defs.cpp:24959
#define def_special_attribute_with_nothing(name)
Definition: all_defs.cpp:24921
#define force_inline
Definition: all_defs.cpp:25029
#define self_recursion(...)
Definition: all_defs.cpp:24963
#define _big_than_
Definition: all_defs.cpp:24975
#define no_vtable_struct
Definition: all_defs.cpp:25040
#define enable_if(...)
Definition: all_defs.cpp:24935
#define distinctive
Definition: all_defs.cpp:25021
#define common_attribute_t
Definition: all_defs.cpp:24924
#define BIT_POSSIBILITY
每个bit(不是字节)的可能性 为什么c艹委员会不定义这个?
Definition: all_defs.cpp:24822
#define enable_adl(name)
Definition: all_defs.cpp:24889
#define def_common_attribute_with_nothing(name)
Definition: all_defs.cpp:24917
constexpr flag(flag_set_type a=not_set) noexcept
Definition: all_defs.cpp:6309
flag(flag &&a) noexcept
Definition: all_defs.cpp:6312
void set() noexcept
Definition: all_defs.cpp:6315
void operator=(flag &) &noexcept=delete
void unset() noexcept
Definition: all_defs.cpp:6316
void operator=(flag &&) &noexcept=delete
flag(flag &a) noexcept
Definition: all_defs.cpp:6311
constexpr same_base_t(const same_base_t< other_T, other_base_t > &a) noexcept(construct< base_t_rw >.nothrow< other_base_t >)
Definition: all_defs.cpp:6496
constexpr value_type operator*() noexcept(noexcept((is_value_getter_noexcept())))
Definition: all_defs.cpp:6500
base_t_w next_getter() const noexcept(is_next_getter_noexcept())
Definition: all_defs.cpp:6462
static constexpr bool is_handle_getter_noexcept() noexcept
Definition: all_defs.cpp:6405
constexpr same_base_t(const this_t &a) noexcept(construct< base_t_rw >.nothrow< const base_t_rw >)
Definition: all_defs.cpp:6493
~same_base_t() noexcept(destruct.nothrow< base_t_rw >)=default
value_t * handle_getter() const noexcept(is_handle_getter_noexcept())
Definition: all_defs.cpp:6413
constexpr void swap_with(this_t &a) noexcept(noexcept((swap((::std::declval< base_t_rw & >()),(::std::declval< base_t_rw & >())))))
Definition: all_defs.cpp:6488
decltype(value_type_getter()) ::template type value_type
Definition: all_defs.cpp:6441
constexpr auto operator<=>(const same_base_t< other_value_t, other_base_t_w > &a) const noexcept(compare.nothrow< base_t_rw, other_base_t_w >)
Definition: all_defs.cpp:6508
constexpr same_base_t() noexcept=default
static constexpr bool is_value_getter_noexcept() noexcept
Definition: all_defs.cpp:6422
constexpr same_base_t(this_t &&a) noexcept(noexcept(((::std::declval< this_t >()).swap_with(a))))
Definition: all_defs.cpp:6494
base_t_w before_getter() const noexcept(is_before_getter_noexcept())
Definition: all_defs.cpp:6479
static constexpr bool is_before_getter_noexcept() noexcept
Definition: all_defs.cpp:6471
constexpr value_t * operator->() noexcept(is_handle_getter_noexcept())
Definition: all_defs.cpp:6499
static constexpr auto value_type_getter()
Definition: all_defs.cpp:6431
same_base_t< value_t, base_t_w > this_t
Definition: all_defs.cpp:6400
static constexpr bool is_next_getter_noexcept() noexcept
Definition: all_defs.cpp:6454
value_type value_getter() const noexcept(is_handle_getter_noexcept())
Definition: all_defs.cpp:6443
constexpr bool operator==(value_t *a) const noexcept(is_handle_getter_noexcept()&&noexcept(pointer_equal((::std::declval< value_t * >()),(::std::declval< value_t * >()))))
Definition: all_defs.cpp:6502
constexpr void add(cons *a) noexcept
Definition: all_defs.cpp:6651
iterator_t< T, cons * > iterator
Definition: all_defs.cpp:6646
constexpr list_t() noexcept
Definition: all_defs.cpp:6650
constexpr iterator begin() noexcept
Definition: all_defs.cpp:6654
constexpr iterator head() noexcept
Definition: all_defs.cpp:6656
constexpr bool empty() const noexcept
Definition: all_defs.cpp:6657
constexpr iterator end() noexcept
Definition: all_defs.cpp:6655
constexpr rot_iterator operator--(int) noexcept
Definition: all_defs.cpp:646
constexpr rot_iterator & operator--() noexcept
Definition: all_defs.cpp:635
constexpr rot_iterator(size_t offset) noexcept
Definition: all_defs.cpp:628
constexpr size_t value() const noexcept
Definition: all_defs.cpp:651
constexpr rot_iterator operator++(int) noexcept
Definition: all_defs.cpp:641
constexpr rot_iterator & operator++() noexcept
Definition: all_defs.cpp:629
constexpr mark_able(mark_type a=not_mark) noexcept
Definition: all_defs.cpp:6342
void mark() const noexcept
Definition: all_defs.cpp:6343
bool was_marked() const noexcept
Definition: all_defs.cpp:6345
void unmark() const noexcept
Definition: all_defs.cpp:6344
constexpr maybe_fail_reference(note::fail_t)
Definition: all_defs.cpp:3304
constexpr maybe_fail_reference(const maybe_fail_reference &)=default
friend this_t operator+(const this_t &a, U &&b) noexcept(noexcept((a.copy()+=b)))
Definition: all_defs.cpp:9025
constexpr auto operator==(array_like_view_t< const T > a) const noexcept(equal.nothrow< array_like_view_t< T > >)
Definition: all_defs.cpp:8969
array_t(const this_t &a) noexcept(noexcept(((::std::declval< this_t >()).copy())))
Definition: all_defs.cpp:8867
friend this_t operator+(U &&a, const this_t &b) noexcept(noexcept((this_t(a)+=b)))
Definition: all_defs.cpp:9029
constexpr iterator get_iterator_at(size_t a) noexcept
Definition: all_defs.cpp:8941
const_iterator_t< T > const_iterator
Definition: all_defs.cpp:8939
this_t && operator+(U &&b) &&noexcept(noexcept((*this+=b)))
Definition: all_defs.cpp:9034
friend this_t & operator+=(this_t &a, zero_t b) noexcept(get< T >.apply_end.nothrow< T >)
Definition: all_defs.cpp:9021
void insert(size_t index, size_t count, const T *data) noexcept(insert_nothrow)
Definition: all_defs.cpp:8907
void insert_with_forward_resize(size_t index, size_t count, const T *data, size_t new_size) noexcept(insert_with_forward_resize_nothrow)
Definition: all_defs.cpp:8920
array_t(U &&a) noexcept(get< T >.as_array.nothrow< U >)
Definition: all_defs.cpp:8859
friend this_t & operator+=(this_t &a, U &&b) noexcept(get< T >.apply_end.nothrow< U >)
Definition: all_defs.cpp:9017
void forward_resize(size_t size) noexcept(forward_resize_nothrow)
Definition: all_defs.cpp:8894
constexpr auto operator==(const this_t &a) const noexcept(equal.nothrow< array_like_view_t< T > >)
Definition: all_defs.cpp:8975
void resize(size_t size) noexcept(resize_nothrow)
Definition: all_defs.cpp:8887
this_t & operator=(const this_t &a) &noexcept(noexcept(((::std::declval< this_t >()).copy())))
Definition: all_defs.cpp:8868
const_iterator end() const noexcept
Definition: all_defs.cpp:8956
iterator find(U &&a) noexcept
Definition: all_defs.cpp:9040
const T & operator[](size_t pos) const noexcept
Definition: all_defs.cpp:8933
~array_t() noexcept(unget.nothrow< T >)
Definition: all_defs.cpp:8877
void swap_with(this_t &a) noexcept
Definition: all_defs.cpp:8830
constexpr auto operator<=>(const this_t &a) const noexcept(compare.nothrow< array_like_view_t< T > >)
Definition: all_defs.cpp:8972
const_iterator cbegin() const noexcept
Definition: all_defs.cpp:8959
size_t size_in_byte() const noexcept
Definition: all_defs.cpp:8883
constexpr auto operator<=>(array_like_view_t< const T > a) const noexcept(compare.nothrow< array_like_view_t< T > >)
Definition: all_defs.cpp:8966
T & operator[](size_t pos) noexcept
Definition: all_defs.cpp:8932
this_t & operator=(this_t &&a) &noexcept
Definition: all_defs.cpp:8872
const_iterator find(U &&a) const noexcept
Definition: all_defs.cpp:9044
void clear() noexcept(re_construct.nothrow< this_t >)
Definition: all_defs.cpp:8929
array_t(note::size_t< size_t >size) noexcept(get< T >.nothrow<>)
Definition: all_defs.cpp:8842
const_iterator cend() const noexcept
Definition: all_defs.cpp:8962
array_t(note::size_t< size_t >size, const T &elem) noexcept(get< T >.nothrow<>)
Definition: all_defs.cpp:8848
constexpr iterator begin() noexcept
Definition: all_defs.cpp:8947
void insert(size_t index, size_t count) noexcept(insert_nothrow)
Definition: all_defs.cpp:8901
constexpr const_iterator begin() const noexcept
Definition: all_defs.cpp:8953
void insert_with_resize(size_t index, size_t count, const T *data, size_t new_size) noexcept(insert_nothrow)
Definition: all_defs.cpp:8913
constexpr const_iterator get_iterator_at(size_t a) const noexcept
Definition: all_defs.cpp:8944
~hash_table_t() noexcept(destruct.nothrow< base_t_w >)=default
void add(const T &a) noexcept(hash_nothrow< const T & > &&bucket_t::add_nothrow)
Definition: all_defs.cpp:10119
bool remove(const T &a) noexcept(bucket_t::remove_nothrow)
Definition: all_defs.cpp:10125
hash_table_t(special_init_t, size_t bucket_size) noexcept
Definition: all_defs.cpp:10096
this_t & operator=(base_t_w &&a) &noexcept
Definition: all_defs.cpp:10105
maybe_fail_reference< T > find(U &&a) noexcept(find_nothrow< U >)
Definition: all_defs.cpp:10141
this_t & operator=(const base_t_w &a) &noexcept
Definition: all_defs.cpp:10109
bool in_table(const T &a) noexcept(noexcept(((::std::declval< this_t >()).find(a).not_fail())))
Definition: all_defs.cpp:10157
bool not_in_table(const T &a) noexcept(noexcept(((::std::declval< this_t >()).in_table(a))))
Definition: all_defs.cpp:10160
void clear() noexcept(re_construct.nothrow< this_t >)
Definition: all_defs.cpp:10172
void clear() noexcept(re_construct.nothrow< this_t >)
Definition: all_defs.cpp:10358
this_t & operator=(const this_t &a) noexcept
Definition: all_defs.cpp:10339
const T & operator[](const key_t &a) const noexcept
Definition: all_defs.cpp:10354
T & operator[](const key_t &a) noexcept(noexcept((_m.add({a, T()}))))
Definition: all_defs.cpp:10346
bool operator==(const this_t &a) const noexcept(shrink_nothow &&equal.nothrow< T >)
Definition: all_defs.cpp:10389
void shrink() const noexcept(shrink_nothow)
Definition: all_defs.cpp:10381
void swap(map_t< T, key_t, stack_t, _ > &a) noexcept
Definition: all_defs.cpp:10344
this_t & operator=(const this_t &a) &noexcept(noexcept(((::std::declval< this_t >()).copy())))
Definition: all_defs.cpp:9827
base_stack_t(const this_t &a) noexcept(noexcept(((::std::declval< this_t >()).copy())))
Definition: all_defs.cpp:9830
hash_t get_top_hash() noexcept(noexcept((hash((::std::declval< T & >())))))
Definition: all_defs.cpp:9916
void clear() noexcept(re_construct.nothrow< this_t >)
Definition: all_defs.cpp:9840
bool remove(const T_ &a) noexcept(remove_nothrow &&equal.nothrow< T_, T >)
Definition: all_defs.cpp:9874
bool not_in_stack(const T &a) const noexcept(noexcept(((::std::declval< this_t >()).in_stack(a))))
Definition: all_defs.cpp:9859
bool in_stack(const T &a) const noexcept(noexcept(((::std::declval< this_t >()).find(a).not_fail())))
Definition: all_defs.cpp:9856
~base_stack_t() noexcept(unget.nothrow< data_t >)
Definition: all_defs.cpp:9831
void add(const T &a) noexcept(add_nothrow)
Definition: all_defs.cpp:9867
struct elc::defs::container::stack_n::base_stack_t::data_t * _m
maybe_fail_reference< T > find(U &&a) noexcept(noexcept(((::std::declval< T & >())==a)))
Definition: all_defs.cpp:9847
this_t & operator=(this_t &&a) &noexcept
Definition: all_defs.cpp:9820
constexpr exception() noexcept=default
virtual void * _abstract_method_get_forward_resize_this(size_t size)=0
virtual size_t abstract_method_get_size_of_get_for_this() noexcept=0
virtual void * _abstract_method_get_resize_this(size_t size)=0
virtual size_t abstract_method_get_size_of_get_for_this() noexcept override
Definition: all_defs.cpp:8070
virtual void * _abstract_method_get_forward_resize_this(size_t size) noexcept(get_forward_resize.able< T >?get_forward_resize.nothrow< T >:1) override
Definition: all_defs.cpp:8061
virtual void abstract_method_unget_this() noexcept(noexcept((unget(get_handle(this))))) override
Definition: all_defs.cpp:8042
virtual void * _abstract_method_get_resize_this(size_t size) noexcept(get_resize.able< T >?get_resize.nothrow< T >:1) override
Definition: all_defs.cpp:8052
virtual void * _abstract_method_copy_get_this() noexcept(copy_get.able< T >?copy_get.nothrow< T >:1) override
Definition: all_defs.cpp:8043
void add_gc_method(type_info_t< T >) noexcept
Definition: all_defs.cpp:10700
void remove_gc_success_identifier(success_identifier_t a)
Definition: all_defs.cpp:10695
void operator()() const noexcept
Definition: all_defs.cpp:10665
void add_gc_method(gc_method_t a) noexcept
Definition: all_defs.cpp:10685
void remove_gc_method(type_info_t< T >) noexcept
Definition: all_defs.cpp:10705
void add_gc_success_identifier(success_identifier_t a) noexcept
Definition: all_defs.cpp:10692
bool success() const noexcept
Definition: all_defs.cpp:10674
void remove_gc_method(gc_method_t a)
Definition: all_defs.cpp:10688
root_of() noexcept(noexcept((roots_of< T >.add((::std::declval< this_t * >())))))
Definition: all_defs.cpp:10568
virtual void map_and_mark() noexcept=0
Definition: all_defs.cpp:10577
constexpr roots_t() noexcept=default
constexpr placement_construct_t operator[](T *p) const noexcept
Definition: all_defs.cpp:5712
T operator()(Args &&...rest) const noexcept(nothrow< Args... >)
Definition: all_defs.cpp:5647
void cut_ref() const noexcept
Definition: all_defs.cpp:8228
constexpr ref_t() noexcept=default
constexpr void add_ref() const noexcept
Definition: all_defs.cpp:8150
constexpr void init_never_ref_num_zero() noexcept
Definition: all_defs.cpp:8154
link_num_t link_num() const noexcept
Definition: all_defs.cpp:8155
bool cut_ref() const noexcept
Definition: all_defs.cpp:8151
arec_t && operator=(const arec_t &&ch) &&noexcept
Definition: all_defs.cpp:17535
arec_t && operator=(char_T a) &&noexcept
Definition: all_defs.cpp:17531
const char_T * operator&() const &&noexcept
Definition: all_defs.cpp:17541
arec_t(string_t *to, size_t index) noexcept
Definition: all_defs.cpp:17528
arec_t(special_init_t, const arec_t &ref) noexcept
Definition: all_defs.cpp:17529
floating_arec_t && operator=(floating_arec_result_type a) &&noexcept
Definition: all_defs.cpp:17611
floating_arec_t(special_init_t, const floating_arec_t &ref) noexcept
Definition: all_defs.cpp:17602
floating_arec_t(string_t *to, float_t index) noexcept
Definition: all_defs.cpp:17598
pointer correct_pointer(pointer a, size_t align)
Definition: all_defs.cpp:3842
constexpr size_t overhead_get_offset_value(size_t align)
Definition: all_defs.cpp:3831
void set_overhead(pointer a, size_t size)
Definition: all_defs.cpp:3851
pointer recorrect_pointer(pointer a, size_t align)
Definition: all_defs.cpp:3845
constexpr size_t correct_size(size_t size, size_t align)
Definition: all_defs.cpp:3836
constexpr size_t overhead_get_align(size_t align)
Definition: all_defs.cpp:3828
constexpr size_t correct_align(size_t align)
Definition: all_defs.cpp:3839
size_t get_overhead(const_pointer a)
Definition: all_defs.cpp:3854
alloc相关基础函数
Definition: all_defs.cpp:3563
void free(byte *p, size_t align) noexcept
Definition: all_defs.cpp:4057
size_t get_size_of_alloc(const byte *p, size_t align) noexcept
Definition: all_defs.cpp:4080
struct elc::APIs::alloc::source_location_info_t operate_source_location
byte * aligned_alloc(size_t align, size_t size) noexcept
Definition: all_defs.cpp:3984
byte * realloc(byte *ptr, size_t nsize, size_t align) noexcept
Definition: all_defs.cpp:4021
终止报错相关基础函数
Definition: all_defs.cpp:4291
void die_with(const char_t *err_msg) noexcept
同 die ,但是有详细的错误信息
Definition: all_defs.cpp:4557
void die() noexcept
终止整个程序并可能的触发断点或输出错误信息
Definition: all_defs.cpp:4543
void base_free_library(library_handle handle) noexcept
Definition: all_defs.cpp:21171
void * get_symbol(library_handle handle, string symbol_name) noexcept
Definition: all_defs.cpp:21200
library_handle load_library(string file_name) noexcept
Definition: all_defs.cpp:21190
void * base_get_symbol(library_handle handle, const char *symbol_name) noexcept
Definition: all_defs.cpp:21179
library_handle base_load_library(const char *file_name) noexcept
Definition: all_defs.cpp:21152
string base_get_load_error() noexcept
Definition: all_defs.cpp:21162
void free_library(library_handle handle) noexcept
Definition: all_defs.cpp:21197
string get_load_error() noexcept
Definition: all_defs.cpp:21194
string_t< char_t > to_char_t_str(string_view_t< char > a) noexcept
Definition: all_defs.cpp:18620
string_t< char > to_char_str(string_view_t< char_t > a) noexcept
Definition: all_defs.cpp:18601
constexpr auto begin_of_array_like(T &&a) noexcept
Definition: all_defs.cpp:1810
constexpr size_t size_of_array_like(T &&) noexcept
Definition: all_defs.cpp:1803
constexpr bool is_array_like_for
Definition: all_defs.cpp:1833
constexpr bool is_not_signal_value_for_array_like
Definition: all_defs.cpp:1830
constexpr bool is_signal_value_for_array_like
Definition: all_defs.cpp:1828
auto end_of_array_like(T &&a) noexcept
Definition: all_defs.cpp:1817
constexpr auto empty_constexpr_str_of
Definition: all_defs.cpp:3078
function_type_getter< T >::type get_function_type
Definition: all_defs.cpp:6713
constexpr auto function_type_getter_conditional_helper()
Definition: all_defs.cpp:6695
void the_pointer_hash() noexcept=delete
struct elc::defs::base::hash_n::hash_t hash
constexpr hash_value_t pointer_hash(T *a) noexcept
Definition: all_defs.cpp:2086
constexpr bool is_unstable_hash
Definition: all_defs.cpp:2080
constexpr bool is_fundamental_hash
Definition: all_defs.cpp:2082
void swap(same_base_t< value_t, base_t_w > &a, same_base_t< value_t, base_t_w > &b) noexcept(noexcept((a.swap_with(b))))
Definition: all_defs.cpp:6514
auto operator<=>(const reverse_base_t< base_t > &a, const reverse_base_t< base_t > &b) noexcept(compare.nothrow< base_t >)
Definition: all_defs.cpp:6375
constexpr auto get_result(auto y1, auto k, auto δx) noexcept
Definition: all_defs.cpp:874
constexpr auto get_reverse_result(auto k, auto δx, auto y) noexcept
Definition: all_defs.cpp:878
constexpr auto get_k(auto y1, auto y2, auto δx) noexcept
Definition: all_defs.cpp:866
requires ::std::is_arithmetic_v< T > constexpr T copy_as_negative(auto x, bool negative=1) noexcept
Definition: all_defs.cpp:500
constexpr void set_rounding(int mode)
Definition: all_defs.cpp:539
requires ::std::is_floating_point_v< T > constexpr auto trunc(const T v) noexcept
Definition: all_defs.cpp:762
requires ::std::is_unsigned_v< T > constexpr auto rotr(const T v, const auto R) noexcept
位操作:循环右移 不使用std版本而是自己写的原因:std版本右操作数只能是int而不能是size_t或别的,标准会傻逼
Definition: all_defs.cpp:610
requires ::std::is_arithmetic_v< T > constexpr bool feq(const T a, const T b) noexcept
Definition: all_defs.cpp:689
constexpr size_t get_next_gold_size_to_resize_for_array(size_t size)
已知当前array的size,求下一个合适的提前分配大小
Definition: all_defs.cpp:848
constexpr auto pow(const T a, const U b) noexcept
Definition: all_defs.cpp:751
constexpr size_t get_next_gold_size_to_resize_for_hash(size_t size)
已知当前hash table的size,求下一个合适的桶大小
Definition: all_defs.cpp:855
requires ::std::is_arithmetic_v< T > constexpr auto abs(const T v) noexcept
Definition: all_defs.cpp:681
constexpr auto sub(const T1 a, const T2 b) noexcept
Definition: all_defs.cpp:694
requires ::std::is_floating_point_v< T > constexpr auto ceil(const T v) noexcept
Definition: all_defs.cpp:773
requires ::std::is_arithmetic_v< T > constexpr auto log(const T a) noexcept
Definition: all_defs.cpp:728
requires ::std::is_arithmetic_v< T1 > and ::std::is_arithmetic_v< T2 > constexpr auto mod(T1 a, T2 b)
Definition: all_defs.cpp:531
requires ::std::is_arithmetic_v< T > constexpr bool is_negative(T x) noexcept
神已死,神万岁.
Definition: all_defs.cpp:488
requires ::std::is_unsigned_v< T > constexpr auto rotl_nomod(const T v, const auto R) noexcept
位操作:循环左移(无mod) 不使用std版本而是自己写的原因:std版本右操作数只能是int而不能是size_t或别的,标准会傻逼
Definition: all_defs.cpp:590
requires ::std::is_unsigned_v< T > constexpr auto rotr_nomod(const T v, const auto r) noexcept
位操作:循环右移(无mod) 不使用std版本而是自己写的原因:std版本右操作数只能是int而不能是size_t或别的,标准会傻逼
Definition: all_defs.cpp:570
requires ::std::is_arithmetic_v< T > constexpr bool is_prime_num(T a)
Definition: all_defs.cpp:787
requires ::std::is_arithmetic_v< T > constexpr size_t to_size_t(T x) noexcept
Definition: all_defs.cpp:515
requires ::std::is_unsigned_v< T > constexpr auto rotl(const T v, const auto R) noexcept
位操作:循环左移 不使用std版本而是自己写的原因:std版本右操作数只能是int而不能是size_t或别的,标准会傻逼
Definition: all_defs.cpp:618
constexpr int get_rounding()
Definition: all_defs.cpp:545
requires ::std::is_arithmetic_v< T >constexpr ::std::uintmax_t to_uintmax_t(T x) noexcept
Definition: all_defs.cpp:523
constexpr auto gold_of_resize
Definition: all_defs.cpp:476
requires ::std::is_floating_point_v< T > constexpr T exp(const T v) noexcept
Definition: all_defs.cpp:709
requires ::std::is_arithmetic_v< T > constexpr T get_prime_num_big_or_eq_than(T a)
求大于某数的素数
Definition: all_defs.cpp:839
constexpr struct elc::defs::base::note_n::fail_t fail
constexpr size_t< T > size(T v)
Definition: all_defs.cpp:1782
constexpr auto get_null_ptr() noexcept
Definition: all_defs.cpp:1367
constexpr struct elc::defs::base::null_ptr_n::null_ptr_t null_ptr
void the_get_null_ptr() noexcept=delete
constexpr size_t find_first_not_of_size_t(array_like_view_t< T >pattern, array_like_view_t< T >range)
若成功找到不匹配的数据项,返回其距离开头的步数,若未找到,返回npos
Definition: all_defs.cpp:2667
constexpr T * base_find_last_of(array_like_view_t< T >pattern, array_like_view_t< T >range)
find_last_of的朴素实现 若成功找到匹配的数据项,返回其开头,若未找到,返回nullptr
Definition: all_defs.cpp:2607
constexpr T * find_last_of_bitmark(const bitmark_for_finds< T > &mark, array_like_view_t< T >range)
find_last_of的bitmark实现 若成功找到匹配的数据项,返回其开头,若未找到,返回nullptr
Definition: all_defs.cpp:2598
constexpr T * in_range_but_reverse(T &pattern, array_like_view_t< T >range)
若成功找到匹配的数据项,返回其开头,若未找到,返回nullptr
Definition: all_defs.cpp:2471
constexpr T * find_last_of(array_like_view_t< T >pattern, array_like_view_t< T >range)
若成功找到匹配的数据项,返回其开头,若未找到,返回nullptr
Definition: all_defs.cpp:2617
constexpr T * base_find_first_not_of(array_like_view_t< T >pattern, array_like_view_t< T >range)
find_first_not_of的朴素实现 若成功找到不匹配的数据项,返回其开头,若未找到,返回nullptr
Definition: all_defs.cpp:2647
constexpr T * find_first_not_of_bitmark(const bitmark_for_finds< T > &mark, array_like_view_t< T >range)
find_first_not_of的bitmark实现 若成功找到不匹配的数据项,返回其开头,若未找到,返回nullptr
Definition: all_defs.cpp:2637
constexpr size_t find_last_not_of_size_t(array_like_view_t< T >pattern, array_like_view_t< T >range)
若成功找到不匹配的数据项,返回其距离开头的步数,若未找到,返回npos
Definition: all_defs.cpp:2707
constexpr T * base_find_last_not_of(array_like_view_t< T >pattern, array_like_view_t< T >range)
find_last_not_of的朴素实现 若成功找到不匹配的数据项,返回其开头,若未找到,返回nullptr
Definition: all_defs.cpp:2687
constexpr size_t find_last_of_size_t(array_like_view_t< T >pattern, array_like_view_t< T >range)
若成功找到匹配的数据项,返回其距离开头的步数,若未找到,返回npos
Definition: all_defs.cpp:2627
constexpr T * find_first_of(array_like_view_t< T >pattern, array_like_view_t< T >range)
若成功找到匹配的数据项,返回其开头,若未找到,返回nullptr
Definition: all_defs.cpp:2578
constexpr size_t in_range_but_reverse_size_t(T &pattern, array_like_view_t< T >range)
若成功找到匹配的数据项,返回其距离开头的步数,若未找到,返回npos
Definition: all_defs.cpp:2480
constexpr size_t find_first_of_size_t(array_like_view_t< T >pattern, array_like_view_t< T >range)
若成功找到匹配的数据项,返回其距离开头的步数,若未找到,返回npos
Definition: all_defs.cpp:2588
constexpr T * find_first_of_bitmark(const bitmark_for_finds< T > &mark, array_like_view_t< T >range)
find_first_of的bitmark实现 若成功找到匹配的数据项,返回其开头,若未找到,返回nullptr
Definition: all_defs.cpp:2558
constexpr T * base_find_first_of(array_like_view_t< T >pattern, array_like_view_t< T >range)
find_first_of的朴素实现 若成功找到匹配的数据项,返回其开头,若未找到,返回nullptr
Definition: all_defs.cpp:2568
constexpr T * find_last_not_of_bitmark(const bitmark_for_finds< T > &mark, array_like_view_t< T >range)
find_last_not_of的bitmark实现 若成功找到不匹配的数据项,返回其开头,若未找到,返回nullptr
Definition: all_defs.cpp:2677
static constexpr size_t npos
用以指定不存在的位置
Definition: all_defs.cpp:2414
constexpr bool in_range(T pattern, const range_t< T >range) noexcept(noexcept((bool((::std::declval< T >())>=(::std::declval< const T >()) &&(::std::declval< T >())<=(::std::declval< const T >())))))
判断一个值是否在某个范围内
Definition: all_defs.cpp:2290
constexpr size_t in_range_size_t(T &pattern, array_like_view_t< T >range)
若成功找到匹配的数据项,返回其距离开头的步数,若未找到,返回npos
Definition: all_defs.cpp:2426
constexpr T * find_first_not_of(array_like_view_t< T >pattern, array_like_view_t< T >range)
若成功找到不匹配的数据项,返回其开头,若未找到,返回nullptr
Definition: all_defs.cpp:2657
constexpr T * find_last_not_of(array_like_view_t< T >pattern, array_like_view_t< T >range)
若成功找到不匹配的数据项,返回其开头,若未找到,返回nullptr
Definition: all_defs.cpp:2697
string_view_t< char_t > string_view
Definition: all_defs.cpp:2903
constexpr struct elc::defs::base::compare_t compare
hash_n::unstable_hash_value_t unstable_hash_t
Definition: all_defs.cpp:2235
constexpr struct elc::defs::base::equal_t equal
void just_a_use(T &&)
Definition: all_defs.cpp:929
static void destroy(T *a) noexcept
Definition: all_defs.cpp:936
auto & assign(T &&a, U &&b) noexcept(noexcept((a=b)))
Definition: all_defs.cpp:921
constexpr bool is_all_byte_zero(T &&a)
Definition: all_defs.cpp:3220
auto template_warning_helper(U &&a) noexcept
Definition: all_defs.cpp:390
::std::remove_cvref_t< T > remove_cvref
Definition: all_defs.cpp:426
constexpr struct elc::defs::base::zero_t zero
constexpr T down_cast(U a) noexcept
Definition: all_defs.cpp:978
constexpr logical_bool neither
Definition: all_defs.cpp:3197
constexpr struct elc::defs::base::just_an_part_t just_an_part
constexpr struct elc::defs::base::min_t min
constexpr struct elc::defs::base::special_init_t special_init
constexpr auto is_eq(T &&a, T &&b) noexcept(noexcept((&a==&b)))
Definition: all_defs.cpp:1516
void the_destroy() noexcept=delete
constexpr ptrdiff_t get_off_set(note::from_t< const_pointer >a, note::to_t< const_pointer >b) noexcept
获取两个指针的偏移
Definition: all_defs.cpp:2038
constexpr bool template_error_helper
Definition: all_defs.cpp:384
constexpr auto unapply_off_set(T *b, ptrdiff_t c) noexcept
反向应用偏移
Definition: all_defs.cpp:2048
constexpr byte * cast_to_data(T *p)
Definition: all_defs.cpp:1948
constexpr struct elc::defs::base::end_by_zero_t end_by_zero
::std::remove_reference_t< T > remove_ref
Definition: all_defs.cpp:430
constexpr type_info_t< T > type_info
Definition: all_defs.cpp:1247
constexpr logical_bool either
Definition: all_defs.cpp:3197
constexpr auto pointer_to_bool(T *a) noexcept
指针转bool的重载接口,允许类对此进行自定义 elc内部的指针转bool应当视情况使用默认配置或此重载接口
Definition: all_defs.cpp:2011
constexpr auto pointer_equal(T *a, T *b) noexcept
指针比较的重载接口,允许类对此进行自定义 elc内部的指针比较应当视情况使用默认配置或此重载接口
Definition: all_defs.cpp:2022
decltype(nullptr) nullptr_t
Definition: all_defs.cpp:1401
constexpr struct elc::defs::base::never_ref_num_zero_t never_ref_num_zero
size_t the_number_of(type_info_t< T >) noexcept
Definition: all_defs.cpp:3253
::std::remove_cv_t< T > remove_cv
Definition: all_defs.cpp:428
constexpr struct elc::defs::base::max_t max
::std::conditional_t< B, T, F > conditional
Definition: all_defs.cpp:432
hash_n::hash_value_t hash_t
Definition: all_defs.cpp:2234
decltype(null_ptr) null_ptr_t
Definition: all_defs.cpp:1400
constexpr T & data_cast(byte *p)
Definition: all_defs.cpp:1942
constexpr const T add_const(T a) noexcept
Definition: all_defs.cpp:963
requires ::std::is_integral_v< T > constexpr size_t number_of_possible_values_per
Definition: all_defs.cpp:1930
auto & attribute_cast(T &t) noexcept
Definition: all_defs.cpp:1096
constexpr auto apply_off_set(T *a, ptrdiff_t c) noexcept
应用偏移
Definition: all_defs.cpp:2043
constexpr bool full_equal_in_byte(const T &a, const T &b)
Definition: all_defs.cpp:1990
constexpr bool operator==(const type_info_t< T > &, const type_info_t< T > &)
Definition: all_defs.cpp:1250
T * get_handle(attribute< T, attribute_name > *a) noexcept
Definition: all_defs.cpp:1073
auto attribute_ptr_cast(T *ptr) noexcept
Definition: all_defs.cpp:1083
constexpr logical_bool unknown
Definition: all_defs.cpp:3197
void the_pointer_equal() noexcept=delete
constexpr invoke_t< T > invoke
Definition: all_defs.cpp:3284
constexpr T & remove_const(const T &a) noexcept
Definition: all_defs.cpp:969
constexpr bool is_pointer
判断类型是否为指针
Definition: all_defs.cpp:2031
void the_pointer_to_bool() noexcept=delete
void discard(T &&)
Definition: all_defs.cpp:927
constexpr size_t bitnumof
Definition: all_defs.cpp:1935
constexpr auto is_not_eq(T &&a, T &&b) noexcept(noexcept((!is_eq(a, b))))
Definition: all_defs.cpp:1520
const void * const_pointer
未知类型指针,不可写
Definition: all_defs.cpp:2035
void * pointer
未知类型指针
Definition: all_defs.cpp:2033
default_func_data_t< Ret_t(Args_t...)> default_func_data
Definition: all_defs.cpp:9241
base_function_t(T) -> base_function_t< Func_t, promise_nothrow_at_destruct >
bool was_an(const_ptr p) noexcept
Definition: all_defs.cpp:13647
map_t< ptr, T > long_term_binary_node_storager
Definition: all_defs.cpp:13724
value eval(ptr p)
Definition: all_defs.cpp:13745
const T & const_use_by_ref_as(const_ptr p) noexcept
Definition: all_defs.cpp:13689
comn_ptr_t< const node_like > const_ptr
Definition: all_defs.cpp:12746
constexpr bool as_value_nothrow_helper() noexcept
Definition: all_defs.cpp:12832
value cdr_of(ptr p)
Definition: all_defs.cpp:13420
decltype(auto) as_value(T &&a) noexcept(as_value_nothrow_helper< T >())
Definition: all_defs.cpp:12845
ptr make_binary_node_from(T a) noexcept
Definition: all_defs.cpp:13720
weak_ptr_t< const node_like > const_weak_ptr
Definition: all_defs.cpp:12747
T use_as(const_ptr p) noexcept
Definition: all_defs.cpp:13708
comn_ptr_t< node_like > ptr
Definition: all_defs.cpp:12744
ptr make_long_term_binary_node_from(T a) noexcept
Definition: all_defs.cpp:13726
value car_of(ptr p)
Definition: all_defs.cpp:13417
weak_ptr_t< node_like > weak_ptr
Definition: all_defs.cpp:12745
decltype(auto) as_ptr(T &&a) noexcept(as_ptr_nothrow_helper< T >())
Definition: all_defs.cpp:12798
ptr make_list() noexcept
Definition: all_defs.cpp:13468
elc::defs::core::nil_t nil
T & use_by_ref_as(ptr p) noexcept
Definition: all_defs.cpp:13685
elc::defs::core::t_t t
maybe_fail_reference< T > maybe_fail_use_by_ref_as(ptr p) noexcept
Definition: all_defs.cpp:13666
library_handle_t get_library_handle_form_symbol(function_t< Func_t > symbol) noexcept
Definition: all_defs.cpp:21754
comn_ptr_t< library_info_t > library_handle_t
Definition: all_defs.cpp:21655
library_handle_t load_lib(string lib_name) noexcept
Definition: all_defs.cpp:21750
string get_symbol_name_form_symbol(function_t< Func_t > symbol) noexcept
Definition: all_defs.cpp:21762
charT toupper(charT c)
Definition: all_defs.cpp:4806
charT tolower(charT c)
Definition: all_defs.cpp:4807
constexpr auto ending_of_expr_beyond_expectations
Definition: all_defs.cpp:5112
constexpr auto core_runtime_internal_helper_leak
Definition: all_defs.cpp:5109
constexpr auto empty_gc_method
Definition: all_defs.cpp:5098
const ::std::locale default_locale
Definition: all_defs.cpp:4793
thread_local ptrdiff_t off_set
Definition: all_defs.cpp:7961
void * get_ptr_after_off_set(void *a) noexcept
Definition: all_defs.cpp:7964
thread_local pointer base_ptr
Definition: all_defs.cpp:7960
void is_base_ptr(void *a) noexcept
Definition: all_defs.cpp:7962
void is_instance_ptr(void *a) noexcept
Definition: all_defs.cpp:7963
void * alloc_method(type_info_t< T >) noexcept
Definition: all_defs.cpp:7013
size_t get_size_of_alloc_method(const T *arg) noexcept
Definition: all_defs.cpp:7026
size_t base_get_size_of_alloc(const byte *arg, size_t align) noexcept
Definition: all_defs.cpp:7005
void * realloc_method(T *&ptr, size_t new_size) noexcept
Definition: all_defs.cpp:7035
byte * base_aligned_alloc(size_t align, size_t size) noexcept
Definition: all_defs.cpp:6979
byte * base_realloc(byte *ptr, size_t nsize, size_t align) noexcept
Definition: all_defs.cpp:6965
void base_free(byte *p, size_t align) noexcept
Definition: all_defs.cpp:6989
constexpr alloc_t< T > alloc
用于对特定类型进行alloc的类实例
Definition: all_defs.cpp:7134
constexpr struct elc::defs::memory::alloc_n::get_size_of_alloc_t get_size_of_alloc
void the_alloc_method() noexcept=delete
void the_free_method() noexcept=delete
constexpr struct elc::defs::memory::alloc_n::free_t free
void the_realloc_method() noexcept=delete
constexpr struct elc::defs::memory::alloc_n::realloc_t realloc
void the_get_size_of_alloc_method() noexcept=delete
void gc_method_of() noexcept
Definition: all_defs.cpp:10789
bool gc_success_identifier_of() noexcept
Definition: all_defs.cpp:10793
void gc_for_alloc() noexcept
当alloc失败时调用此函数
Definition: all_defs.cpp:10830
size_t forward_alloc_size_grow_with_insert_uninitialized_data(T *&arg, size_t to_size, size_t insert_pos, size_t insert_size) noexcept(move.trivial< T > or move.nothrow< T >)
Definition: all_defs.cpp:7491
constexpr struct elc::defs::memory::get_n::copy_get_t copy_get
constexpr struct elc::defs::memory::get_n::get_resize_t get_resize
constexpr struct elc::defs::memory::get_n::unget_t unget
void forward_alloc_size_cut(T *&arg, size_t to_size) noexcept(move.trivial< T > or move.nothrow< T >)
Definition: all_defs.cpp:7435
void alloc_size_cut(T *&arg, size_t to_size) noexcept
Definition: all_defs.cpp:7343
void alloc_size_grow(T *&arg, size_t to_size) noexcept(move.trivial< T > or move.nothrow< T >)
Definition: all_defs.cpp:7348
constexpr struct elc::defs::memory::get_n::get_size_of_get_t get_size_of_get
constexpr get_t< T > get
Definition: all_defs.cpp:7626
void forward_alloc_size_grow(T *&arg, size_t to_size) noexcept(move.trivial< T > or move.nothrow< T >)
Definition: all_defs.cpp:7461
void alloc_size_grow_with_insert_uninitialized_data(T *&arg, size_t insert_pos, size_t insert_size) noexcept(move.trivial< T > or move.nothrow< T >)
Definition: all_defs.cpp:7371
constexpr bool copy_construct_nothrow
Definition: all_defs.cpp:5573
constexpr bool destruct_trivial
Definition: all_defs.cpp:5566
constexpr bool move_assign_trivial
Definition: all_defs.cpp:5600
constexpr bool move_assign_able
Definition: all_defs.cpp:5596
constexpr struct elc::defs::memory::lifetime_n::move_construct_t move_construct
constexpr bool move_construct_nothrow
Definition: all_defs.cpp:5581
T * super_speed_trivial_copy_from_one(T *to, const T &value, size_t size) noexcept
Definition: all_defs.cpp:5604
constexpr bool destruct_nothrow
Definition: all_defs.cpp:5564
constexpr bool copy_assign_able
Definition: all_defs.cpp:5588
constexpr struct elc::defs::memory::lifetime_n::copy_assign_t copy_assign
constexpr bool construct_nothrow
Definition: all_defs.cpp:5556
constexpr bool copy_construct_able
Definition: all_defs.cpp:5571
constexpr bool copy_construct_trivial
Definition: all_defs.cpp:5575
constexpr bool construct_trivial
Definition: all_defs.cpp:5558
constexpr bool move_assign_nothrow
Definition: all_defs.cpp:5598
constexpr struct elc::defs::memory::lifetime_n::destruct_t destruct
constexpr struct elc::defs::memory::lifetime_n::copy_construct_t copy_construct
constexpr bool move_construct_trivial
Definition: all_defs.cpp:5583
constexpr bool copy_assign_trivial
Definition: all_defs.cpp:5592
constexpr construct_t< T > construct
Definition: all_defs.cpp:5725
constexpr struct elc::defs::memory::lifetime_n::move_t move
constexpr bool copy_assign_nothrow
Definition: all_defs.cpp:5590
constexpr bool move_construct_able
Definition: all_defs.cpp:5579
constexpr struct elc::defs::memory::lifetime_n::copy_t copy
void map_all(func_t &&a) noexcept(noexcept(((::std::declval< func_t >())((::std::declval< T * >())))))
Definition: all_defs.cpp:8720
void map_all_helper(func_t &&a)
Definition: all_defs.cpp:8711
void destroy_and_free(T *a) noexcept
Definition: all_defs.cpp:8180
void the_destroy_and_free() noexcept=delete
link_num_t get_ref_num(const T *a) noexcept
Definition: all_defs.cpp:8198
void waiting_for_destroy(T *a) noexcept
Definition: all_defs.cpp:8172
constexpr bool was_weak_ref_able
Definition: all_defs.cpp:8195
void map_and_mark_for_gc() noexcept=delete
void the_waiting_for_destroy() noexcept=delete
::std::size_t link_num_t
Definition: all_defs.cpp:8144
link_num_t get_weak_ref_num(const T *a) noexcept
Definition: all_defs.cpp:8204
constexpr bool was_ref_able
Definition: all_defs.cpp:8193
null_string_data_t< char_T > null_string_data
Definition: all_defs.cpp:15275
string_t(const char_T *) -> string_t< char_T >
string_t< char_t > string
Definition: all_defs.cpp:12754
value arec_as_value(string_t< char_T > &str, const value index)
Definition: all_defs.cpp:19607
bool file_exists(const string &name) noexcept
Definition: all_defs.cpp:24032
string get_system_drive() noexcept
Definition: all_defs.cpp:24058
string get_elc_runtime_lib_path() noexcept
Definition: all_defs.cpp:24070
string get_program_data_path() noexcept
Definition: all_defs.cpp:24046
constexpr auto package_symbol_loader_file_name
Definition: all_defs.cpp:24095
string elc_runtime_lib_path
Definition: all_defs.cpp:24098
string package_symbol_loader_path
Definition: all_defs.cpp:24099
Definition: all_defs.cpp:64
int64_t int_t
Definition: all_defs.cpp:68
long double float_size_t
Definition: all_defs.cpp:74
char32_t char_t
Definition: all_defs.cpp:66
double float_t
Definition: all_defs.cpp:72
uint64_t uint_t
Definition: all_defs.cpp:70
constexpr source_location_guard(size_t lookup=0) noexcept
Definition: all_defs.cpp:3932
constexpr const char * file() noexcept
Definition: all_defs.cpp:3935
constexpr uint_least32_t line() noexcept
Definition: all_defs.cpp:3936
static constexpr size_t get_length_of(T *ptr)
Definition: all_defs.cpp:1887
constexpr size_t size() const noexcept
Definition: all_defs.cpp:1860
constexpr const_iterator c_str() const noexcept
Definition: all_defs.cpp:1859
constexpr const_iterator begin() const noexcept
Definition: all_defs.cpp:1864
constexpr T & operator[](size_t pos) noexcept
Definition: all_defs.cpp:1872
constexpr array_like_view_t(T *a, size_t b) noexcept
Definition: all_defs.cpp:1849
constexpr const T & operator[](size_t pos) const noexcept
Definition: all_defs.cpp:1873
constexpr array_like_view_t(const this_t &) noexcept=default
constexpr auto operator<=>(this_t a) noexcept(compare.nothrow< T >)
Definition: all_defs.cpp:1875
constexpr bool empty() const noexcept
Definition: all_defs.cpp:1870
constexpr auto operator==(this_t a) noexcept(equal.nothrow< T >)
Definition: all_defs.cpp:1878
constexpr array_like_view_t(U &&a) noexcept(noexcept((begin_of_array_like< T >(a), size_of_array_like< T >(a))))
Definition: all_defs.cpp:1851
void swap_with(this_t &b) noexcept(noexcept((swap(_begin, b._begin), swap(_size, b._size))))
Definition: all_defs.cpp:1854
constexpr const_iterator cbegin() const noexcept
Definition: all_defs.cpp:1867
constexpr const_iterator end() const noexcept
Definition: all_defs.cpp:1865
constexpr const_iterator cend() const noexcept
Definition: all_defs.cpp:1868
friend const U * get_handle(const attribute< U, another_attribute_name > *) noexcept
friend U * get_handle(attribute< U, another_attribute_name > *) noexcept
constexpr const T * get_handle() const noexcept
Definition: all_defs.cpp:1070
constexpr T * get_handle() noexcept
Definition: all_defs.cpp:1066
自动重整类型名并在析构时释放重整结果,对于gcc和clang的傻逼实现
Definition: all_defs.cpp:1144
constexpr base_type_info_t(const base_type_info_t &) noexcept=default
constexpr base_type_info_t(const ::std::type_info &a) noexcept
Definition: all_defs.cpp:1160
bool operator==(const base_type_info_t &a) const noexcept
Definition: all_defs.cpp:1166
size_t get_hash() const noexcept
Definition: all_defs.cpp:1163
bool operator==(const ::std::type_info &a) const noexcept
Definition: all_defs.cpp:1167
type_name_t get_name() const noexcept
Definition: all_defs.cpp:2983
constexpr auto operator()(T *a, size_t size1, U *b, end_by_zero_t) const noexcept(nothrow< T, U >)
Definition: all_defs.cpp:1616
constexpr auto reverse(strong_ordering odr) const noexcept
Definition: all_defs.cpp:1744
constexpr auto operator()(T(&a)[N1], U(&b)[N2]) const noexcept(nothrow< T, U >)
Definition: all_defs.cpp:1599
constexpr auto reverse(partial_ordering odr) const noexcept
Definition: all_defs.cpp:1728
constexpr auto operator()(T *a, size_t size1, U *b, size_t size2) const noexcept(nothrow< T, U >)
Definition: all_defs.cpp:1608
constexpr auto reverse(weak_ordering odr) const noexcept
Definition: all_defs.cpp:1736
decltype(base_call((::std::declval< T >()),(::std::declval< U >()))) type
Definition: all_defs.cpp:1584
constexpr auto lexicographical(T *a, size_t size1, just_an_part_t, U *b, end_by_zero_t) const noexcept(nothrow< T, U >)
Definition: all_defs.cpp:1716
constexpr auto operator()(T *a, U *b, size_t size) const noexcept(nothrow< T, U >)
Definition: all_defs.cpp:1591
constexpr auto operator()(T *a, size_t size1, just_an_part_t, U *b, end_by_zero_t) const noexcept(nothrow< T, U >)
Definition: all_defs.cpp:1654
constexpr auto lexicographical(T *a, size_t size1, U *b, end_by_zero_t) const noexcept(nothrow< T, U >)
Definition: all_defs.cpp:1678
constexpr auto operator()(T &&a, U &&b) const noexcept(nothrow< T, U >)
Definition: all_defs.cpp:1587
constexpr auto lexicographical(T(&a)[N1], U(&b)[N2]) const noexcept(nothrow< T, U >)
Definition: all_defs.cpp:1674
constexpr auto lexicographical(T *a, size_t size1, U *b, size_t size2) const noexcept(nothrow< T, U >)
Definition: all_defs.cpp:1667
static constexpr bool able
Definition: all_defs.cpp:1557
constexpr auto operator()(T *a, end_by_zero_t, U *b, end_by_zero_t) const noexcept(nothrow< T, U >)
Definition: all_defs.cpp:1642
constexpr auto operator()(T *a, end_by_zero_t, U *b, size_t size2) const noexcept(nothrow< T, U >)
Definition: all_defs.cpp:1629
static constexpr bool nothrow
Definition: all_defs.cpp:1564
constexpr auto lexicographical(T *a, end_by_zero_t, U *b, size_t size2) const noexcept(nothrow< T, U >)
Definition: all_defs.cpp:1691
static constexpr auto base_call(T &&a, U &&b) noexcept(nothrow< T, U >)
Definition: all_defs.cpp:1573
constexpr auto lexicographical(T *a, end_by_zero_t, U *b, end_by_zero_t) const noexcept(nothrow< T, U >)
Definition: all_defs.cpp:1704
constexpr cons_t()=default
constexpr constexpr_str_t_literal_helper(const char_T(&str)[N]) noexcept
Definition: all_defs.cpp:3059
range_n::bitmark_for_finds< const char_T > bitmark_for_finds
Definition: all_defs.cpp:3044
range_n::reverse_match_pattern< const char_T > reverse_match_pattern
Definition: all_defs.cpp:3043
constexpr constexpr_str_t(const char_T *str, size_t size)
Definition: all_defs.cpp:3046
range_n::match_pattern< const char_T > match_pattern
Definition: all_defs.cpp:3042
constexpr constexpr_str_t(const char_T *str)
Definition: all_defs.cpp:3053
constexpr hash_t hash() const noexcept
Definition: all_defs.cpp:3054
constexpr constexpr_str_view_t substr(const char_T *begin) const noexcept
Definition: all_defs.cpp:3030
constexpr const char_T * data() const noexcept
Definition: all_defs.cpp:3015
constexpr constexpr_str_view_t substr(size_t pos, size_t len) const noexcept
Definition: all_defs.cpp:3018
constexpr constexpr_str_view_t substr(const char_T *begin, size_t len) const noexcept
Definition: all_defs.cpp:3027
constexpr const char_T * str() const noexcept
Definition: all_defs.cpp:3014
constexpr constexpr_str_view_t substr(size_t pos, const char_T *end) const noexcept
Definition: all_defs.cpp:3024
constexpr constexpr_str_view_t substr(size_t pos) const noexcept
Definition: all_defs.cpp:3021
constexpr_str_view_t(const char_T *str) noexcept=delete
constexpr constexpr_str_view_t substr(const char_T *begin, const char_T *end) const noexcept
Definition: all_defs.cpp:3033
constexpr data_view(T *p)
Definition: all_defs.cpp:1977
constexpr bool operator()(T *a, end_by_zero_t, U *b, end_by_zero_t) const noexcept(nothrow< T, U >)
Definition: all_defs.cpp:1492
constexpr bool operator()(T *a, U *b, size_t size) const noexcept(nothrow< T, U >)
Definition: all_defs.cpp:1454
constexpr bool operator()(T *a, size_t size1, just_an_part_t, U *b, end_by_zero_t) const noexcept(nothrow< T, U >)
Definition: all_defs.cpp:1503
constexpr bool operator()(T *a, size_t size1, U *b, end_by_zero_t) const noexcept(nothrow< T, U >)
Definition: all_defs.cpp:1478
static constexpr bool able
Definition: all_defs.cpp:1445
constexpr bool operator()(T *a, end_by_zero_t, U *b, size_t size2) const noexcept(nothrow< T, U >)
Definition: all_defs.cpp:1488
constexpr bool operator()(T *a, size_t size1, U *b, size_t size2) const noexcept(nothrow< T, U >)
Definition: all_defs.cpp:1471
static constexpr bool nothrow
Definition: all_defs.cpp:1447
constexpr bool operator()(T(&a)[N1], U(&b)[N2]) const noexcept(nothrow< T, U >)
Definition: all_defs.cpp:1462
constexpr auto operator()(T &&a, U &&b) const noexcept(nothrow< T, U >)
Definition: all_defs.cpp:1450
Ret_t operator()(Args_t...args) const noexcept(nothrow||invoke< const T >.nothrow< Args_t... >)
Definition: all_defs.cpp:6741
decltype(function_type_getter_conditional_helper< T >()) ::template type type
Definition: all_defs.cpp:6705
constexpr hash_base_t get_hash_in_base_type(const T &a) const noexcept(nothrow< T >)
Definition: all_defs.cpp:2161
constexpr hash_value_t repeat_times(hash_value_t value, size_t size) const noexcept
Definition: all_defs.cpp:2177
constexpr hash_value_t repeat_times(T &&value, size_t size) const noexcept
Definition: all_defs.cpp:2208
constexpr hash_value_t with_calculated_before(hash_value_t before, size_t before_size, const T *a, size_t size) const noexcept
Definition: all_defs.cpp:2167
hash_value_t merge_array_hash_results(hash_value_t before, size_t before_size, hash_value_t after, size_t after_size) const noexcept
Definition: all_defs.cpp:2216
constexpr hash_value_t with_calculated_before(hash_value_t before, size_t before_size, const array_like_view_t< T >a) const noexcept
Definition: all_defs.cpp:2226
static constexpr bool nothrow_helper() noexcept
Definition: all_defs.cpp:2095
static constexpr bool able_helper() noexcept
Definition: all_defs.cpp:2114
constexpr hash_base_t operator%(auto &&a) const noexcept
Definition: all_defs.cpp:2068
constexpr bool operator==(const hash_value_t &a) const noexcept
Definition: all_defs.cpp:2071
unstable_hash_value_t(const hash_value_t &a) noexcept
Definition: all_defs.cpp:2076
auto _as(Args &&...rest) const noexcept(nothrow< Args... >)
Definition: all_defs.cpp:3279
base_iterator_t< value_t, base_t_w > this_t
Definition: all_defs.cpp:6519
constexpr this_t operator+(ptrdiff_t num) const noexcept(noexcept((this_t(--(::std::declval< this_t & >())),++(::std::declval< this_t & >()))))
Definition: all_defs.cpp:6535
constexpr this_t operator-(ptrdiff_t num) const noexcept(noexcept(((::std::declval< this_t & >())+0)))
Definition: all_defs.cpp:6549
constexpr this_t operator++(int) &noexcept(noexcept((this_t(++(::std::declval< this_t & >())))))
Definition: all_defs.cpp:6533
constexpr this_t & operator--() &noexcept(is_before_getter_noexcept())
Definition: all_defs.cpp:6532
constexpr this_t & operator++() &noexcept(is_next_getter_noexcept())
Definition: all_defs.cpp:6531
same_base_t< value_t, base_t_w > base_t
Definition: all_defs.cpp:6520
constexpr this_t & operator=(const base_t_rw &a) &noexcept(copy_assign.nothrow< base_t_rw >)
Definition: all_defs.cpp:6529
constexpr this_t & operator=(base_t_rw &&a) &noexcept(move_assign.nothrow< base_t_rw >)
Definition: all_defs.cpp:6530
constexpr this_t operator--(int) &noexcept(noexcept((this_t(--(::std::declval< this_t & >())))))
Definition: all_defs.cpp:6534
constexpr reverse_base_t(build_base_t_T &&a) noexcept(construct< base_t_rw >.nothrow< build_base_t_T >)
Definition: all_defs.cpp:6369
auto get_handle() noexcept(noexcept(((::std::declval< base_t_w >()).get_handle())))
Definition: all_defs.cpp:6372
auto get_next() noexcept(noexcept(((::std::declval< base_t_w >()).get_before())))
Definition: all_defs.cpp:6371
auto get_before() noexcept(noexcept(((::std::declval< base_t_w >()).get_next())))
Definition: all_defs.cpp:6370
constexpr logical_bool(bool a)
Definition: all_defs.cpp:3176
constexpr logical_bool(const logical_bool &)=default
constexpr logical_bool(special_init_t, bool is_true, bool is_false, bool is_unknown=0)
Definition: all_defs.cpp:3175
friend logical_bool operator&&(logical_bool a, logical_bool b) noexcept
Definition: all_defs.cpp:3185
constexpr logical_bool operator!() const
Definition: all_defs.cpp:3180
friend logical_bool operator||(logical_bool a, logical_bool b) noexcept
Definition: all_defs.cpp:3188
constexpr logical_bool & operator=(const logical_bool &) &=default
friend logical_bool operator==(logical_bool a, logical_bool b) noexcept
Definition: all_defs.cpp:3191
constexpr auto operator()(::std::initializer_list< T >l) const
Definition: all_defs.cpp:1331
constexpr auto operator()(Args &&...rest) const
Definition: all_defs.cpp:1327
constexpr auto operator()(type_info_t< T >) const
Definition: all_defs.cpp:1335
constexpr auto operator()(::std::initializer_list< T >l) const
Definition: all_defs.cpp:1303
constexpr auto operator()(Args &&...rest) const
Definition: all_defs.cpp:1299
constexpr auto operator()(type_info_t< T >) const
Definition: all_defs.cpp:1307
constexpr non_copy_assign_able() noexcept=default
constexpr non_copy_construct_able(non_copy_construct_able &&)=default
constexpr non_copy_construct_able(const non_copy_construct_able &)=delete
constexpr non_move_assign_able() noexcept=default
constexpr non_move_construct_able(const non_move_construct_able &)=default
constexpr non_move_construct_able(non_move_construct_able &&)=delete
constexprauto base_get() const noexcept
Definition: all_defs.cpp:1386
bitmark提供了一种快速进行四种泛搜索的实现,前提是构建中的pattern中的每一项的usigned表示都在一个字节(表长)内。 若bitmark构建失败,程序应当使用正在进行的泛搜索的朴素实现版本...
Definition: all_defs.cpp:2529
constexpr bool mark(array_like_view_t< T >pattern) noexcept
Definition: all_defs.cpp:2534
constexpr bool operator[](T &index) const noexcept
Definition: all_defs.cpp:2548
BMH2改算法表头,用以实施头起始的快速子串匹配算法 大部分情况下应当编译时预构建或对运行时生成的实例进行缓存
Definition: all_defs.cpp:2303
constexpr T * match(array_like_view_t< T >range) const noexcept
Definition: all_defs.cpp:2332
constexpr void build_table(array_like_view_t< T >pattern) noexcept
Definition: all_defs.cpp:2314
constexpr match_pattern(array_like_view_t< T >pattern) noexcept
Definition: all_defs.cpp:2329
static constexpr index_type get_index_of(T &ch) noexcept
Definition: all_defs.cpp:2311
用以表示某类型的数值范围,仅可表示闭区间
Definition: all_defs.cpp:2256
constexpr range_t(note::from_t< const T >begin, note::to_t< const T >end)
Definition: all_defs.cpp:2260
constexpr auto end() noexcept
Definition: all_defs.cpp:2266
constexpr auto begin() noexcept
Definition: all_defs.cpp:2267
constexpr range_t(note::to_t< const T >end, note::from_t< const T >begin)
Definition: all_defs.cpp:2261
constexpr range_t(const T begin, note::size_t< const T >size)
Definition: all_defs.cpp:2262
constexpr size_t size() noexcept
Definition: all_defs.cpp:2265
constexpr auto begin() const noexcept
Definition: all_defs.cpp:2269
constexpr auto end() const noexcept
Definition: all_defs.cpp:2268
constexpr range_t(const T begin, note::size_t< size_t >size)
Definition: all_defs.cpp:2263
constexpr range_t(const T begin, const T end)
Definition: all_defs.cpp:2259
反向BMH2改算法表头,用以实施尾起始的快速子串匹配算法 大部分情况下应当编译时预构建或对运行时生成的实例进行缓存
Definition: all_defs.cpp:2359
constexpr T * match(array_like_view_t< T >range) const noexcept
Definition: all_defs.cpp:2388
constexpr reverse_match_pattern(array_like_view_t< T >pattern) noexcept
Definition: all_defs.cpp:2385
static constexpr index_type get_index_of(T &ch) noexcept
Definition: all_defs.cpp:2367
constexpr void build_table(array_like_view_t< T >pattern) noexcept
Definition: all_defs.cpp:2370
array_like_view_t的特化类型,表明这是字符串
Definition: all_defs.cpp:2817
constexpr string_view_t substr(const char_T *begin) const noexcept
Definition: all_defs.cpp:2840
constexpr const char_T * str() const noexcept
Definition: all_defs.cpp:2824
constexpr size_t find_last_not_of(const constexpr_str_t< char_T > &str) const
Definition: all_defs.cpp:2899
constexpr size_t find_first_not_of(string_view_t str) const
Definition: all_defs.cpp:2884
constexpr size_t reverse_find(string_view_t str) const
Definition: all_defs.cpp:2856
constexpr size_t find_last_not_of(string_view_t str) const
Definition: all_defs.cpp:2887
constexpr size_t find_last_of(const constexpr_str_t< char_T > &str) const
Definition: all_defs.cpp:2893
array_like_view_t< const char_T > base_t
Definition: all_defs.cpp:2819
constexpr size_t find_first_of(string_view_t str) const
Definition: all_defs.cpp:2878
constexpr string_view_t substr(const char_T *begin, size_t len) const noexcept
Definition: all_defs.cpp:2837
constexpr size_t reverse_find(const char_T ch) const
Definition: all_defs.cpp:2850
constexpr string_view_t(const char_T *str) noexcept
Definition: all_defs.cpp:2822
constexpr size_t find_first_not_of(const constexpr_str_t< char_T > &str) const
Definition: all_defs.cpp:2896
constexpr size_t find_last_of(const char_T ch) const
Definition: all_defs.cpp:2869
constexpr size_t find_last_of(string_view_t str) const
Definition: all_defs.cpp:2881
constexpr string_view_t substr(const char_T *begin, const char_T *end) const noexcept
Definition: all_defs.cpp:2843
constexpr size_t reverse_find(const constexpr_str_t< char_T > &str) const
Definition: all_defs.cpp:2862
constexpr size_t find(string_view_t str) const
Definition: all_defs.cpp:2853
constexpr string_view_t substr(size_t pos) const noexcept
Definition: all_defs.cpp:2831
constexpr size_t find_first_not_of(const char_T ch) const
Definition: all_defs.cpp:2872
constexpr string_view_t substr(size_t pos, size_t len) const noexcept
Definition: all_defs.cpp:2828
constexpr string_view_t substr(size_t pos, const char_T *end) const noexcept
Definition: all_defs.cpp:2834
constexpr size_t find_first_of(const constexpr_str_t< char_T > &str) const
Definition: all_defs.cpp:2890
constexpr size_t find(const constexpr_str_t< char_T > &str) const
Definition: all_defs.cpp:2859
constexpr size_t find_first_of(const char_T ch) const
Definition: all_defs.cpp:2866
constexpr size_t find_last_not_of(const char_T ch) const
Definition: all_defs.cpp:2875
constexpr size_t find(const char_T ch) const
Definition: all_defs.cpp:2847
constexpr const char_T * data() const noexcept
Definition: all_defs.cpp:2825
type_name_t get_name() const noexcept
Definition: all_defs.cpp:2990
static constexpr bool not_has_has_attribute_helper()
Definition: all_defs.cpp:1207
constexpr bool operator==(const ::std::type_info &a) const noexcept
Definition: all_defs.cpp:1239
constexpr type_info_t() noexcept
Definition: all_defs.cpp:1236
constexpr type_info_t(const type_info_t &) noexcept=default
static constexpr bool has_attribute_helper()
Definition: all_defs.cpp:1199
type_name_t(const type_name_t &other) noexcept
复制构造函数
Definition: all_defs.cpp:2969
string_view_t< char > base_t
Definition: all_defs.cpp:2924
~type_name_t() noexcept
析构函数
Definition: all_defs.cpp:2975
type_name_t(const char *original_name) noexcept
构造函数
Definition: all_defs.cpp:2967
static base_t demangle(const char *original_name) noexcept
重整器包装
Definition: all_defs.cpp:2926
type_name_t(type_name_t &&other) noexcept
移动构造函数(swap)
Definition: all_defs.cpp:2971
static base_t copy_demangle(base_t demangled_name) noexcept
复制重整结果
Definition: all_defs.cpp:2950
virtual base_type_info_t get_type_info() const noexcept=0
virtual Ret_t call(Args_t...) noexcept(noexcept((Ret_t()))) override final
Definition: all_defs.cpp:9233
virtual base_type_info_t get_type_info() const noexcept override final
Definition: all_defs.cpp:9234
virtual const void * get_data_begin() const noexcept override final
Definition: all_defs.cpp:9235
virtual bool equal_with(const void *) const noexcept override final
Definition: all_defs.cpp:9238
virtual bool equal_with(const void *a) const noexcept(equal.able< T >?equal.nothrow< T >:true) override final
Definition: all_defs.cpp:9206
virtual func_ptr_t get_func_ptr() const noexcept override final
Definition: all_defs.cpp:9217
virtual base_type_info_t get_type_info() const noexcept override final
Definition: all_defs.cpp:9202
function_data_warpper_t< T, Ret_t(Args_t...)> data_t
Definition: all_defs.cpp:9194
virtual const void * get_data_begin() const noexcept override final
Definition: all_defs.cpp:9203
virtual Ret_t call(Args_t...args) noexcept(invoke< T >.nothrow< Args_t... >) override final
Definition: all_defs.cpp:9212
bool operator==(const data_t &a) const noexcept(noexcept((a._value==*_m)))
Definition: all_defs.cpp:10303
auto_stack_t(base_t &&a) noexcept(noexcept((base_t(a))))
Definition: all_defs.cpp:9953
this_t & operator=(this_t &&a) &noexcept
Definition: all_defs.cpp:9955
auto_stack_t(const base_t &a) noexcept(noexcept((base_t(a))))
Definition: all_defs.cpp:9952
maybe_fail_reference< T > find(U &&a) noexcept(noexcept(((::std::declval< T & >())==a)))
Definition: all_defs.cpp:9957
bool in_stack(const T &a) const noexcept(noexcept(((::std::declval< this_t >()).find(a).not_fail())))
Definition: all_defs.cpp:9971
bool not_in_stack(const T &a) const noexcept(noexcept(((::std::declval< this_t >()).in_stack(a))))
Definition: all_defs.cpp:9974
virtual logical_bool equal_with(const_ptr a) const noexcept override
Definition: all_defs.cpp:13535
virtual void clear() noexcept override
Definition: all_defs.cpp:13549
base_binary_function_node(function_t< void(ptr)> func) noexcept
Definition: all_defs.cpp:13519
virtual base_type_info_t get_type_info() const noexcept override
Definition: all_defs.cpp:13532
base_binary_function_node(function_t< value(ptr)> func) noexcept
Definition: all_defs.cpp:13518
virtual value be_call(ptr arg_list) override
Definition: all_defs.cpp:13533
base_binary_function_node(function_t< void()> func) noexcept
Definition: all_defs.cpp:13525
virtual value arec(const value index) override
Definition: all_defs.cpp:13547
virtual base_type_info_t get_type_info() const noexcept override
Definition: all_defs.cpp:13266
virtual constexpr size_t eq_level() const noexcept override
Definition: all_defs.cpp:13269
virtual constexpr size_t equal_level() const noexcept override
Definition: all_defs.cpp:13268
virtual constexpr ~base_constexpr_t() noexcept override=default
virtual void clear() noexcept override final
Definition: all_defs.cpp:13276
virtual void be_replace_as(ptr) noexcept override
Definition: all_defs.cpp:13278
virtual base_type_info_t get_type_info() const noexcept override final
Definition: all_defs.cpp:13567
virtual base_type_info_t get_additional_type_info() const noexcept=0
virtual void throw_self_ptr() override
Definition: all_defs.cpp:13605
virtual value arec(const value index) noexcept(arec_nothrow_helper) override
Definition: all_defs.cpp:13627
binary_node_t(const T &a) noexcept
Definition: all_defs.cpp:13586
virtual void throw_self_ptr() const override
Definition: all_defs.cpp:13604
virtual base_type_info_t get_additional_type_info() const noexcept override
Definition: all_defs.cpp:13589
virtual logical_bool equal_with(const_ptr a) const noexcept override
Definition: all_defs.cpp:13620
virtual logical_bool eq_with(const_ptr a) const noexcept override
Definition: all_defs.cpp:13606
virtual void clear() noexcept(clear_nothrow_helper) override
Definition: all_defs.cpp:13638
virtual value be_eval() override
Definition: all_defs.cpp:13757
virtual base_type_info_t get_type_info() const noexcept override
Definition: all_defs.cpp:13775
virtual logical_bool equal_with(const_ptr a) const noexcept override
Definition: all_defs.cpp:13393
map_t< value, const_weak_ptr > _m
Definition: all_defs.cpp:13389
virtual void clear() noexcept override
Definition: all_defs.cpp:13402
virtual base_type_info_t get_type_info() const noexcept override
Definition: all_defs.cpp:13391
virtual value arec(const value index) override
Definition: all_defs.cpp:13400
cons(ptr car, ptr cdr)
Definition: all_defs.cpp:13436
virtual value arec(const value index) override
Definition: all_defs.cpp:13450
virtual logical_bool equal_with(const_ptr a) const noexcept override
Definition: all_defs.cpp:13443
virtual base_type_info_t get_type_info() const noexcept override
Definition: all_defs.cpp:13441
virtual void clear() noexcept override
Definition: all_defs.cpp:13465
virtual value be_eval() override
Definition: all_defs.cpp:13495
virtual base_type_info_t get_type_info() const noexcept override
Definition: all_defs.cpp:13498
virtual logical_bool equal_with(const_ptr a) const noexcept override
Definition: all_defs.cpp:13331
virtual base_type_info_t get_type_info() const noexcept override
Definition: all_defs.cpp:13329
const_ptr operator&() const noexcept
Definition: all_defs.cpp:12941
value operator()(Args &&...rest)
Definition: all_defs.cpp:12917
virtual base_type_info_t get_type_info() const noexcept=0
virtual constexpr size_t eq_level() const noexcept
Definition: all_defs.cpp:12889
virtual constexpr size_t equal_level() const noexcept
Definition: all_defs.cpp:12888
virtual void waiting_for_destroy() noexcept
Definition: all_defs.cpp:12947
virtual void be_replace_as(ptr a) noexcept
Definition: all_defs.cpp:12908
node_like() noexcept=default
virtual ~node_like()=default
virtual value arec(const value)=0
logical_bool operator==(const this_t &a) const noexcept
Definition: all_defs.cpp:12942
value operator[](auto &&index)
Definition: all_defs.cpp:12898
virtual void clear() noexcept=0
logical_bool eq(const_ptr a) const noexcept
Definition: all_defs.cpp:12919
logical_bool equal(const_ptr a) const noexcept
Definition: all_defs.cpp:12929
virtual void be_replace_as(ptr) noexcept override
Definition: all_defs.cpp:13358
virtual logical_bool equal_with(const_ptr a) const noexcept override
Definition: all_defs.cpp:13352
virtual base_type_info_t get_type_info() const noexcept override
Definition: all_defs.cpp:13350
virtual ~base_data_t() noexcept=default
virtual base_type_info_t get_type_info() const noexcept override final
Definition: all_defs.cpp:13060
constexpr_data_t(const constexpr_data_t &) noexcept=default
virtual ~constexpr_data_t() noexcept override final=default
virtual ptr get_value() noexcept override final
Definition: all_defs.cpp:13058
virtual base_data_t * copy() const noexcept override final
Definition: all_defs.cpp:13059
virtual ~null_data_t() noexcept override final=default
virtual base_type_info_t get_type_info() const noexcept override final
Definition: all_defs.cpp:13047
virtual ptr get_value() noexcept override final
Definition: all_defs.cpp:13045
virtual base_data_t * copy() const noexcept override final
Definition: all_defs.cpp:13046
virtual base_type_info_t get_type_info() const noexcept override final
Definition: all_defs.cpp:13073
variable_data_t(const variable_data_t &) noexcept=default
virtual ptr get_value() noexcept override final
Definition: all_defs.cpp:13071
virtual ~variable_data_t() noexcept override final=default
virtual base_data_t * copy() const noexcept override final
Definition: all_defs.cpp:13072
value(this_t &&a) noexcept=default
value(const this_t &a) noexcept=default
value(node_like *a) noexcept
Definition: all_defs.cpp:13081
auto operator!=(auto &&a) const
Definition: all_defs.cpp:13138
this_t & operator>>(this_t a) noexcept
Definition: all_defs.cpp:13119
auto operator[](T &&index)
Definition: all_defs.cpp:13125
const_ptr operator&() const
Definition: all_defs.cpp:13105
constexpr value(special_init_t) noexcept
Definition: all_defs.cpp:13079
~value() noexcept=default
void re_ref_to(this_t a) noexcept
Definition: all_defs.cpp:13116
auto operator==(auto &&a) const noexcept
Definition: all_defs.cpp:13130
value(base_data_t *a) noexcept
Definition: all_defs.cpp:13082
void ref_to(this_t a) noexcept
Definition: all_defs.cpp:13110
value(ptr a) noexcept
Definition: all_defs.cpp:13080
this_t & operator=(auto &&a)
Definition: all_defs.cpp:13092
void un_ref() noexcept
Definition: all_defs.cpp:13113
virtual constexpr size_t eq_level() const noexcept override
Definition: all_defs.cpp:13301
virtual base_type_info_t get_type_info() const noexcept override
Definition: all_defs.cpp:13298
virtual constexpr size_t equal_level() const noexcept override
Definition: all_defs.cpp:13300
virtual logical_bool equal_with(const_ptr a) const noexcept override
Definition: all_defs.cpp:13302
constexpr library_info_t(special_init_t) noexcept
Definition: all_defs.cpp:21664
void * get_symbol(string symbol_name) noexcept
Definition: all_defs.cpp:21689
symbol_t & get_symbol_as(string symbol_name) noexcept
Definition: all_defs.cpp:21693
library_info_t(string lib_name) noexcept
Definition: all_defs.cpp:21669
symbol_t(library_handle_t lib, string symbol_name, Ret_t(*self)(Args_t...) noexcept(nothrow)) noexcept
Definition: all_defs.cpp:21724
用于对特定类型进行alloc的类
Definition: all_defs.cpp:7105
T * operator()() const noexcept
Definition: all_defs.cpp:7122
static T * base_call(size_t size) noexcept
Definition: all_defs.cpp:7112
constexpr alloc_array_t operator[](size_t a) const noexcept
Definition: all_defs.cpp:7128
static T * base_call() noexcept
Definition: all_defs.cpp:7107
T * operator()(size_t size) const noexcept
Definition: all_defs.cpp:7123
对于特定类型的内存分配结果,获取分配大小并复制一份同样大小的内存
Definition: all_defs.cpp:7208
static T * base_call(const T *arg) noexcept(nothrow< T >)
Definition: all_defs.cpp:7215
T * operator()(const T *arg) const noexcept(nothrow< T >)
Definition: all_defs.cpp:7221
用于对特定类型进行free
Definition: all_defs.cpp:7138
static void base_call(T *p) noexcept
Definition: all_defs.cpp:7141
void operator()(T *p) const noexcept
Definition: all_defs.cpp:7147
用于自特定类型的内存分配结果获取分配大小 对于null_ptr,返回0 对于单个对象的分配,返回1
Definition: all_defs.cpp:7186
static size_t base_call(const T *arg) noexcept(nothrow< T >)
Definition: all_defs.cpp:7193
size_t operator()(const T *arg) const noexcept(nothrow< T >)
Definition: all_defs.cpp:7201
用于对特定类型进行realloc
Definition: all_defs.cpp:7152
constexpr realloc_array_t operator[](size_t a) const noexcept
Definition: all_defs.cpp:7180
static void base_call(T *&ptr, size_t nsize) noexcept
Definition: all_defs.cpp:7155
void operator()(T *&ptr, size_t nsize) const noexcept
Definition: all_defs.cpp:7172
mark_able_for_gc(const mark_able_for_gc &) noexcept
Definition: all_defs.cpp:10594
static T * base_call(const T *arg) noexcept(nothrow< T >)
Definition: all_defs.cpp:7844
T * operator()(const T *arg) const noexcept(nothrow< T >)
Definition: all_defs.cpp:7853
static void base_call(T *&arg, const size_t to_size) noexcept(nothrow< T >)
Definition: all_defs.cpp:7750
static constexpr struct elc::defs::memory::get_n::get_forward_resize_t::insert_resize_t insert_with_resize
void operator()(T *&arg, size_t to_size) const noexcept(nothrow< T >)
Definition: all_defs.cpp:7776
T * operator()(T *&&arg, size_t to_size) const noexcept(nothrow< T >)
Definition: all_defs.cpp:7780
static constexpr struct elc::defs::memory::get_n::get_resize_t::insert_resize_t insert_with_resize
static void base_call(T *&arg, const size_t to_size) noexcept(nothrow< T >)
Definition: all_defs.cpp:7670
T * operator()(T *&&arg, size_t to_size) const noexcept(nothrow< T >)
Definition: all_defs.cpp:7700
void operator()(T *&arg, size_t to_size) const noexcept(nothrow< T >)
Definition: all_defs.cpp:7695
static constexpr struct elc::defs::memory::get_n::get_resize_t::insert_t insert
static size_t base_call(const T *arg) noexcept(nothrow< T >)
Definition: all_defs.cpp:7826
size_t operator()(const T *arg) const noexcept(nothrow< T >)
Definition: all_defs.cpp:7832
T * operator()(note::to_t< T *& > to, const T &a) const noexcept(nothrow< void >)
Definition: all_defs.cpp:7585
T * operator()(note::to_t< T *& > to, array_like_view_t< const T >a) const noexcept(nothrow< void >)
Definition: all_defs.cpp:7576
T * operator()(note::to_t< T *& > to, T &&a) const noexcept(nothrow< void >)
Definition: all_defs.cpp:7593
T * operator()(Args &&...rest) const noexcept(nothrow< Args... >)
Definition: all_defs.cpp:7544
T * operator()(array_like_view_t< const T >a) const noexcept(nothrow< void >)
Definition: all_defs.cpp:7559
bool operator()(array_like_view_t< const T >a, note::from_t< T * >from) const noexcept(nothrow< void >)
Definition: all_defs.cpp:7609
T * operator()(Args &&...rest) const noexcept(nothrow< Args... >)
Definition: all_defs.cpp:7536
constexpr array_get_t operator[](size_t size) const noexcept
Definition: all_defs.cpp:7551
void operator()(T *a) const noexcept(nothrow< T >)
Definition: all_defs.cpp:7636
static constexpr bool nothrow
Definition: all_defs.cpp:7633
void operator()(T *a, decltype(destruct)::not_t) const noexcept(nothrow< T >)
Definition: all_defs.cpp:7657
T * operator()(const T &v) const noexcept(nothrow< const T & >)
Definition: all_defs.cpp:5669
T * operator()(Args &&...rest) const noexcept(nothrow< Args... >)
Definition: all_defs.cpp:5663
void base_call(Args &&...rest) const noexcept(nothrow< Args... >)
Definition: all_defs.cpp:5658
constexpr array_construct_t operator[](size_t size) const noexcept
Definition: all_defs.cpp:5710
void base_call(Args &&...rest) const noexcept(nothrow< Args... >)
Definition: all_defs.cpp:5688
T * operator()(Args &&...rest) const noexcept(nothrow< Args... >)
Definition: all_defs.cpp:5692
T * operator()(const T &v) const noexcept(nothrow< const T & >)
Definition: all_defs.cpp:5697
T * operator()(T *to, const T *from) const noexcept(nothrow< T >)
Definition: all_defs.cpp:6143
T * operator()(note::to_t< T * >to, note::from_t< const T * >from) const noexcept(nothrow< T >)
Definition: all_defs.cpp:6147
T * operator()(const T &from, note::to_t< T * >to) const noexcept(nothrow< T >)
Definition: all_defs.cpp:6155
T * operator()(note::from_t< const T * >from, note::to_t< T * >to) const noexcept(nothrow< T >)
Definition: all_defs.cpp:6151
T * operator()(note::to_t< T * >to, const T &from) const noexcept(nothrow< T >)
Definition: all_defs.cpp:6159
static T * base_call(T *to, const T &from, size_t size) noexcept(nothrow< T >)
Definition: all_defs.cpp:6126
static T * base_call(T *to, const T *from, size_t size) noexcept(nothrow< T >)
Definition: all_defs.cpp:6116
static T & base_call(T &a, const T &b) noexcept(nothrow< T >)
Definition: all_defs.cpp:6106
T & operator()(T &a, const T &b) const noexcept(nothrow< T >)
Definition: all_defs.cpp:6136
constexpr array_copy_assign_t operator[](size_t a) const noexcept
Definition: all_defs.cpp:6163
T * operator()(T *to, const T *from) const noexcept(nothrow< T >)
Definition: all_defs.cpp:5932
T * operator()(T *to, const T &from) const noexcept(nothrow< T >)
Definition: all_defs.cpp:5936
T * operator()(note::from_t< const T * >from, note::to_t< T * >to) const noexcept(nothrow< T >)
Definition: all_defs.cpp:5944
T * operator()(note::to_t< T * >to, note::from_t< const T * >from) const noexcept(nothrow< T >)
Definition: all_defs.cpp:5940
T * operator()(T *to, const T *from) const noexcept(nothrow< T >)
Definition: all_defs.cpp:5878
T * operator()(note::from_t< const T * >from, note::to_t< T * >to) const noexcept(nothrow< T >)
Definition: all_defs.cpp:5886
static T * base_call(T *to, const T *from) noexcept(nothrow< T >)
Definition: all_defs.cpp:5852
T * operator()(T *to, const T &from) const noexcept(nothrow< T >)
Definition: all_defs.cpp:5926
static T * base_call(T *to, const T &from, size_t size) noexcept(nothrow< T >)
Definition: all_defs.cpp:5914
T * operator()(note::to_t< T * >to, note::from_t< const T * >from) const noexcept(nothrow< T >)
Definition: all_defs.cpp:5882
static T * base_call(T *to, const T &from) noexcept(nothrow< T >)
Definition: all_defs.cpp:5903
T * operator()(T *to, const T *from, size_t size) const noexcept(nothrow< T >)
Definition: all_defs.cpp:5891
T * operator()(note::to_t< T * >to, note::from_t< const T * >from, size_t size) const noexcept(nothrow< T >)
Definition: all_defs.cpp:5895
static T * base_call(T *to, const T *from, size_t size) noexcept(nothrow< T >)
Definition: all_defs.cpp:5867
constexpr array_copy_construct_t operator[](size_t a) const noexcept
Definition: all_defs.cpp:5948
T * operator()(note::from_t< const T * >from, note::to_t< T * >to, size_t size) const noexcept(nothrow< T >)
Definition: all_defs.cpp:5899
void operator()(T *begin) const noexcept(nothrow< T >)
Definition: all_defs.cpp:5771
static void base_call(T *to) noexcept(nothrow< T >)
Definition: all_defs.cpp:5745
constexpr array_destruct_t operator[](size_t size) const noexcept
Definition: all_defs.cpp:5776
constexpr not_t operator!() const noexcept
Definition: all_defs.cpp:5780
static void base_call(T *begin, size_t size) noexcept(nothrow< T >)
Definition: all_defs.cpp:5756
void operator()(T *begin) const noexcept(nothrow< T >)
Definition: all_defs.cpp:5764
T * operator()(T *to, T *from) const noexcept(nothrow< T >)
Definition: all_defs.cpp:6204
T * operator()(note::from_t< T * >from, note::to_t< T * >to) const noexcept(nothrow< T >)
Definition: all_defs.cpp:6212
T * operator()(note::to_t< T * >to, note::from_t< T * >from) const noexcept(nothrow< T >)
Definition: all_defs.cpp:6208
static T & base_call(T &a, T &&b) noexcept(nothrow< T >)
Definition: all_defs.cpp:6177
static T * base_call(T *to, T *from, size_t size) noexcept(nothrow< T >)
Definition: all_defs.cpp:6186
constexpr array_move_assign_t operator[](size_t a) const noexcept
Definition: all_defs.cpp:6216
T & operator()(T &a, T &b) const noexcept(nothrow< T >)
Definition: all_defs.cpp:6197
T * operator()(note::to_t< T * >to, note::from_t< T * >from) const noexcept(nothrow< T >)
Definition: all_defs.cpp:6012
T * operator()(T *to, T *from) const noexcept(nothrow< T >)
Definition: all_defs.cpp:6008
T * operator()(note::from_t< T * >from, note::to_t< T * >to) const noexcept(nothrow< T >)
Definition: all_defs.cpp:6016
constexpr array_move_construct_t operator[](size_t a) const noexcept
Definition: all_defs.cpp:6020
T * operator()(note::to_t< T * >to, note::from_t< T * >from) const noexcept(nothrow< T >)
Definition: all_defs.cpp:5998
static T * base_call(T *to, T *from, size_t size) noexcept(nothrow< T >)
Definition: all_defs.cpp:5978
T * operator()(note::from_t< T * >from, note::to_t< T * >to) const noexcept(nothrow< T >)
Definition: all_defs.cpp:6002
static T * base_call(T *to, T *from) noexcept(nothrow< T >)
Definition: all_defs.cpp:5966
T * operator()(T *to, T *from) const noexcept(nothrow< T >)
Definition: all_defs.cpp:5994
T * operator()(note::to_t< T * >to, note::from_t< T * >from) const noexcept(nothrow< T >)
Definition: all_defs.cpp:6065
T * operator()(note::from_t< T * >from, note::to_t< T * >to) const noexcept(nothrow< T >)
Definition: all_defs.cpp:6069
T * operator()(T *to, T *from) const noexcept(nothrow< T >)
Definition: all_defs.cpp:6061
T * operator()(note::from_t< T * >from, note::to_t< T * >to) const noexcept(nothrow< T >)
Definition: all_defs.cpp:6055
static T * base_call(T *to, T *from, size_t size) noexcept(nothrow< T >)
Definition: all_defs.cpp:6038
static T * base_call(T *to, T *from) noexcept(nothrow< T >)
Definition: all_defs.cpp:6032
T * operator()(note::to_t< T * >to, note::from_t< T * >from) const noexcept(nothrow< T >)
Definition: all_defs.cpp:6051
T * operator()(T *to, T *from) const noexcept(nothrow< T >)
Definition: all_defs.cpp:6047
constexpr remove_ref< T > && operator()(T &&a) const noexcept
Definition: all_defs.cpp:6077
constexpr array_move_t operator[](size_t a) const noexcept
Definition: all_defs.cpp:6073
T * operator()(Args &&...rest) const noexcept(nothrow< T, Args... >)
Definition: all_defs.cpp:5814
constexpr array_re_construct_t< T > operator[](size_t size) const noexcept
Definition: all_defs.cpp:5831
T * operator()(Args &&...rest) const noexcept(nothrow< T, Args... >)
Definition: all_defs.cpp:5826
T * operator()(T *to) const noexcept(nothrow< T >)
Definition: all_defs.cpp:5804
constexpr placement_re_construct_t< T > operator[](T *p) const noexcept
Definition: all_defs.cpp:5834
constexpr void be_replace_as(T *new_p) noexcept
Definition: all_defs.cpp:8674
constexpr void be_replace_as(nullptr_t) noexcept
Definition: all_defs.cpp:8681
constexpr bool replaced() const noexcept
Definition: all_defs.cpp:8667
constexpr T * get_ptr() const noexcept
Definition: all_defs.cpp:8668
T & operator*() const noexcept(get_nothrow)
Definition: all_defs.cpp:8471
base_ptr_t & operator=(const same_ptr &a) &noexcept(reset_nothrow &&get_nothrow)
Definition: all_defs.cpp:8477
base_ptr_t & operator=(const base_ptr_t &a) &noexcept(reset_nothrow &&get_nothrow)
Definition: all_defs.cpp:8478
base_ptr_t & operator=(null_ptr_t) &noexcept(reset_nothrow)
Definition: all_defs.cpp:8481
T * operator->() const noexcept(get_nothrow)
Definition: all_defs.cpp:8470
ptr_t< T, ref_type, do_replace_check > base_t
Definition: all_defs.cpp:8453
base_ptr_t(base_ptr_t &a) noexcept
Definition: all_defs.cpp:8467
base_ptr_t & operator=(nullptr_t) &noexcept(reset_nothrow)
Definition: all_defs.cpp:8482
auto operator!() const noexcept(get_nothrow)
Definition: all_defs.cpp:8473
base_ptr_t< T, ref_type, do_replace_check > this_t
Definition: all_defs.cpp:8454
base_ptr_t & operator=(same_ref &&a) &noexcept
Definition: all_defs.cpp:8479
base_ptr_t(base_ptr_t &&a) noexcept
Definition: all_defs.cpp:8468
base_ptr_t & operator=(base_ptr_t &&a) &noexcept
Definition: all_defs.cpp:8480
base_ptr_t & operator=(T *a) &noexcept(reset_nothrow)
Definition: all_defs.cpp:8476
void do_replace(T *p) noexcept(replace_check_nothrow &&reset_nothrow)
Definition: all_defs.cpp:8382
auto operator==(nullptr_t) const noexcept(noexcept((operator==(null_ptr))))
Definition: all_defs.cpp:8408
auto operator==(const ptr_t< T, ref_type_, do_replace_check_ > &b) const noexcept(noexcept((pointer_equal((::std::declval< const this_t & >()).get(), b.get()))))
Definition: all_defs.cpp:8415
bool unique() const noexcept
Definition: all_defs.cpp:8397
constexpr ptr_t(nullptr_t=nullptr) noexcept
Definition: all_defs.cpp:8368
constexpr conditional< do_replace_check &&type_info< T >. template has_attribute_helper< replace_able >(), unstable_hash_t, hash_t > hash() const noexcept(noexcept((elc::defs::hash(get()))))
Definition: all_defs.cpp:8400
ptr_t(const same_ref &a) noexcept
Definition: all_defs.cpp:8349
constexpr ptr_t(null_ptr_t) noexcept
Definition: all_defs.cpp:8369
same_ref_p_t< T, ref_type > same_ref
Definition: all_defs.cpp:8330
ptr_t(const same_ptr &a) noexcept
Definition: all_defs.cpp:8340
void reset(T *a) const noexcept(reset_nothrow)
Definition: all_defs.cpp:8373
void replace_check() const noexcept(replace_check_nothrow)
Definition: all_defs.cpp:8377
ptr_t(ptr_t &&a) noexcept
Definition: all_defs.cpp:8352
ptr_t(T *a, special_init_t) noexcept
Definition: all_defs.cpp:8338
auto operator==(null_ptr_t) const noexcept(noexcept((operator==((T *) null_ptr))))
Definition: all_defs.cpp:8411
ptr_t(const ptr_t &a) noexcept
Definition: all_defs.cpp:8350
~ptr_t() noexcept(cut_nothrow)
Definition: all_defs.cpp:8370
void do_replace(const ptr_t< T, ref_type_, do_replace_check_ > &p) noexcept(replace_check_nothrow &&reset_nothrow)
Definition: all_defs.cpp:8389
void reset(nullptr_t=nullptr) const noexcept(reset_nothrow)
Definition: all_defs.cpp:8374
auto operator==(const T *a) const noexcept(noexcept((pointer_equal(add_const((::std::declval< const this_t & >()).get()), a))))
Definition: all_defs.cpp:8405
ptr_t< T, ref_type, do_replace_check > this_t
Definition: all_defs.cpp:8327
constexpr ptr_t(T *a) noexcept
Definition: all_defs.cpp:8339
same_ref_p_t< T, ref_type > base_t
Definition: all_defs.cpp:8329
T * get() const noexcept(get_nothrow)
Definition: all_defs.cpp:8393
ptr_t(const ptr_t< remove_cv< T >, ref_type, do_replace_check > &a) noexcept
Definition: all_defs.cpp:8351
virtual T & get() noexcept override
Definition: all_defs.cpp:10879
virtual void map_and_mark() noexcept override
Definition: all_defs.cpp:10882
same_ptr_p_t(const same_ptr_p_t &) noexcept=default
static void cut_ref(T *a) noexcept(cut_nothrow)
Definition: all_defs.cpp:8313
void swap_with(same_ref_p_t &a) noexcept
Definition: all_defs.cpp:8309
same_ref_p_t(const same_ptr_p_t< T > &a) noexcept
Definition: all_defs.cpp:8307
void cut_ref() const noexcept(noexcept((cut_ref(nullptr))))
Definition: all_defs.cpp:8316
static void add_ref(T *a) noexcept
Definition: all_defs.cpp:8314
void inter_namespace(const value namespace_name)
Definition: all_defs.cpp:23375
value get_symbol_type_map(ptr thenamespace)
Definition: all_defs.cpp:23334
ptr get_symbol_namespace(auto &&index)
Definition: all_defs.cpp:23358
ptr get_symbol_namespace(const value index)
Definition: all_defs.cpp:23352
value get_symbol(const value index)
Definition: all_defs.cpp:23366
bool has_symbol(const value index)
Definition: all_defs.cpp:23359
value get_symbol_type(auto &&index)
Definition: all_defs.cpp:23373
value get_symbol_type(const value index)
Definition: all_defs.cpp:23370
function_t< ptr(string lib_name, size_t lib_ver, string symbol_name) noexcept > load_interface
Definition: all_defs.cpp:24533
size_t read(T *v, size_t size=1)
Definition: all_defs.cpp:12134
virtual size_t read(byte *buf, size_t size)=0
void write(const T *v, size_t size=1)
Definition: all_defs.cpp:12126
virtual void write(const byte *buf, size_t size)=0
virtual void seek_to(void *)=0
virtual void * seek(seek_type, int_t)=0
virtual void flush() noexcept override
Definition: all_defs.cpp:22781
virtual void sync() noexcept override
Definition: all_defs.cpp:22778
virtual void seek_to(void *p) noexcept override
Definition: all_defs.cpp:22775
virtual void close() noexcept override
Definition: all_defs.cpp:22784
size_t bufsize() const noexcept
Definition: all_defs.cpp:22757
virtual void write(const byte *buf, size_t size) noexcept override
Definition: all_defs.cpp:22789
virtual void * seek(seek_type st, int_t offsize) noexcept override
Definition: all_defs.cpp:22760
virtual size_t read(byte *buf, size_t size) noexcept override
Definition: all_defs.cpp:22796
virtual size_t read(byte *buf, size_t size) noexcept override=0
size_t read(T *v, size_t size=1) noexcept
Definition: all_defs.cpp:12160
void write(const T *v, size_t size=1) noexcept
Definition: all_defs.cpp:12153
virtual void write(const byte *buf, size_t size) noexcept override=0
virtual ~noexcept_stream() noexcept override=default
virtual void sync() noexcept override=0
virtual void seek_to(void *) noexcept override=0
virtual compare_type same_struct_compare(ptr_t with) noexcept(compare.nothrow< char_T >)=0
static void be_replace(this_t *a, ptr_t b) noexcept(ptr_reset_nothrow)
Definition: all_defs.cpp:15190
compare_type compare_with(ptr_t with) noexcept(compare.nothrow< char_T >)
Definition: all_defs.cpp:15024
static void be_replace(ptr_t &a, ptr_t b) noexcept(ptr_reset_nothrow)
Definition: all_defs.cpp:15193
virtual bool same_struct_equal(ptr_t with) noexcept(equal.nothrow< char_T >)=0
virtual void copy_part_data_to(char_T *to, size_t pos, size_t size) noexcept(copy_assign_nothrow)=0
virtual ptr_t do_pop_front(size_t size, ptr_t &self) noexcept(construct_nothrow &&copy_assign_nothrow)
Definition: all_defs.cpp:14886
virtual float_size_t get_base_memory_cost() noexcept=0
hash_t get_hash(ptr_t &p) noexcept(hash_nothrow)
Definition: all_defs.cpp:15140
bool equal_with(ptr_t with) noexcept(equal.nothrow< char_T >)
Definition: all_defs.cpp:14917
compare_type compare_with(ptr_t with, size_t pos, size_t size) noexcept(compare.nothrow< char_T >)
Definition: all_defs.cpp:15053
virtual char_T arec(size_t index) noexcept(copy_construct_nothrow &&move_construct_nothrow)=0
virtual ~base_string_data_t() noexcept(destruct_nothrow)=default
virtual range_t< const char_T * > get_the_largest_complete_data_block_begin_form(size_t begin) noexcept=0
compare_type default_compare_method(ptr_t with) noexcept(compare.nothrow< char_T >)
Definition: all_defs.cpp:15048
bool equal_with(const char_T *with) noexcept(equal.nothrow< char_T >)
Definition: all_defs.cpp:14998
bool equal_with(ptr_t with, size_t pos, size_t size) noexcept(equal.nothrow< char_T >)
Definition: all_defs.cpp:14950
hash_t get_others_hash_with_calculated_before(hash_t before, size_t before_size, ptr_t &p, size_t pos, size_t size) noexcept(hash_nothrow)
Definition: all_defs.cpp:15155
virtual hash_t get_others_hash_with_calculated_before_detail(hash_t before, size_t before_size, ptr_t &p, size_t pos, size_t size) noexcept(hash_nothrow)
Definition: all_defs.cpp:15161
virtual char_T * get_c_str(ptr_t &) noexcept(get_data_nothrow)
Definition: all_defs.cpp:15526
virtual hash_t get_hash_detail(ptr_t &p) noexcept(hash_nothrow)
Definition: all_defs.cpp:15149
static void equivalent_optimization(auto &&a, auto &&b) noexcept(ptr_reset_nothrow)
Definition: all_defs.cpp:15196
virtual const char_T * get_data(ptr_t &p) noexcept(get_data_nothrow)
Definition: all_defs.cpp:14866
compare_type compare_with(string_view_t with) noexcept(compare.nothrow< char_T >)
Definition: all_defs.cpp:15080
virtual const range_n::reverse_match_pattern< const char_T > & get_reverse_match_pattern_from_self(ptr_t &self) noexcept(copy_assign_nothrow &&move_construct_nothrow)
Definition: all_defs.cpp:15557
virtual const range_n::match_pattern< const char_T > & get_match_pattern_from_self(ptr_t &self) noexcept(copy_assign_nothrow &&move_construct_nothrow)
Definition: all_defs.cpp:15551
bool default_equal_method(ptr_t with) noexcept(equal.nothrow< char_T >)
Definition: all_defs.cpp:14945
bool equal_with(string_view_t with) noexcept(equal.nothrow< char_T >)
Definition: all_defs.cpp:14977
compare_type compare_with(const char_T *with) noexcept(compare.nothrow< char_T >)
Definition: all_defs.cpp:15101
virtual void be_replace_as(ptr_t a) noexcept(clear_nothrow) override final
Definition: all_defs.cpp:15470
comn_string_data_t(ptr_t str, size_t pos, size_t size) noexcept(construct_nothrow &&copy_assign_nothrow)
Definition: all_defs.cpp:15455
virtual void arec_set(size_t index, char_T a, ptr_t &p) noexcept(copy_assign_nothrow &&move_construct_nothrow) override final
Definition: all_defs.cpp:15486
virtual base_t::compare_type same_struct_compare(ptr_t with) noexcept(compare.nothrow< char_T >) override final
Definition: all_defs.cpp:15503
virtual bool same_struct(ptr_t) noexcept override final
Definition: all_defs.cpp:15495
virtual char_T arec(size_t index) noexcept(copy_construct_nothrow &&move_construct_nothrow) override final
Definition: all_defs.cpp:15485
comn_string_data_t(size_t size) noexcept(construct_nothrow &&copy_assign_nothrow)
Definition: all_defs.cpp:15462
virtual const range_n::reverse_match_pattern< const char_T > & get_reverse_match_pattern_from_self(ptr_t &self) noexcept(copy_assign_nothrow &&move_construct_nothrow) override final
Definition: all_defs.cpp:15518
virtual bool same_struct_equal(ptr_t with) noexcept(equal.nothrow< char_T >) override final
Definition: all_defs.cpp:15499
comn_string_data_t(string_view_t str) noexcept(construct_nothrow &&copy_assign_nothrow)
Definition: all_defs.cpp:15446
virtual const range_n::match_pattern< const char_T > & get_match_pattern_from_self(ptr_t &self) noexcept(copy_assign_nothrow &&move_construct_nothrow) override final
Definition: all_defs.cpp:15512
virtual void copy_part_data_to(char_T *to, size_t pos, size_t size) noexcept(copy_assign_nothrow) override final
Definition: all_defs.cpp:15483
virtual size_t get_size() noexcept override final
Definition: all_defs.cpp:15481
virtual float_size_t get_base_memory_cost() noexcept override final
Definition: all_defs.cpp:15508
virtual char_T * get_c_str(ptr_t &) noexcept override final
Definition: all_defs.cpp:15474
comn_string_data_t(size_t size, char_T ch) noexcept(construct_nothrow &&copy_assign_nothrow)
Definition: all_defs.cpp:15459
virtual range_t< const char_T * > get_the_largest_complete_data_block_begin_form(size_t begin) noexcept override final
Definition: all_defs.cpp:15498
virtual ~comn_string_data_t() noexcept(destruct_nothrow) override final
Definition: all_defs.cpp:15466
virtual char_T * get_unique_c_str(ptr_t &p) noexcept(get_data_nothrow) override final
Definition: all_defs.cpp:15475
comn_string_data_t(ptr_t str) noexcept(construct_nothrow &&copy_assign_nothrow)
Definition: all_defs.cpp:15450
virtual range_t< const char_T * > get_the_largest_complete_data_block_begin_form(size_t begin) noexcept override final
Definition: all_defs.cpp:15366
virtual const range_n::match_pattern< const char_T > & get_match_pattern_from_self(ptr_t &self) noexcept(copy_assign_nothrow &&move_construct_nothrow) override final
Definition: all_defs.cpp:15384
virtual const char_T * get_const_c_str(ptr_t &p) noexcept(get_data_nothrow) override final
Definition: all_defs.cpp:15348
virtual bool same_struct(ptr_t with) noexcept override final
Definition: all_defs.cpp:15363
virtual bool same_struct_equal(ptr_t with) noexcept(equal.nothrow< char_T >) override final
Definition: all_defs.cpp:15367
virtual float_size_t get_base_memory_cost() noexcept override final
Definition: all_defs.cpp:15380
virtual const char_T * get_data(ptr_t &) noexcept(get_data_nothrow) override final
Definition: all_defs.cpp:15347
virtual base_t::compare_type same_struct_compare(ptr_t with) noexcept(compare.nothrow< char_T >) override final
Definition: all_defs.cpp:15373
virtual size_t get_size() noexcept override final
Definition: all_defs.cpp:15354
constexpr_string_data_t(const constexpr_str_t< char_T > &str) noexcept
Definition: all_defs.cpp:15326
virtual void copy_part_data_to(char_T *to, size_t pos, size_t size) noexcept(copy_assign_nothrow) override final
Definition: all_defs.cpp:15356
virtual const range_n::reverse_match_pattern< const char_T > & get_reverse_match_pattern_from_self(ptr_t &self) noexcept(copy_assign_nothrow &&move_construct_nothrow) override final
Definition: all_defs.cpp:15391
virtual ptr_t get_substr_data(size_t begin, size_t size) noexcept override final
Definition: all_defs.cpp:15344
virtual ~constexpr_string_data_t() noexcept(destruct_nothrow) override final
Definition: all_defs.cpp:15340
virtual void be_replace_as(ptr_t a) noexcept(clear_nothrow) override final
Definition: all_defs.cpp:15360
virtual void arec_set(size_t index, char_T a, ptr_t &p) noexcept override final
Definition: all_defs.cpp:15361
virtual char_T arec(size_t index) noexcept(copy_construct_nothrow &&move_construct_nothrow) override final
Definition: all_defs.cpp:15358
virtual ptr_t apply_str_to_begin(string_view_t str) noexcept(copy_construct_nothrow &&apply_data_nothrow) override final
Definition: all_defs.cpp:16180
virtual void be_replace_as(ptr_t a) noexcept(clear_nothrow) override final
Definition: all_defs.cpp:16084
virtual ptr_t apply_str_to_end(string_view_t str) noexcept(copy_construct_nothrow &&apply_data_nothrow) override final
Definition: all_defs.cpp:16160
virtual ptr_t apply_str_to_end(ptr_t str) noexcept(apply_data_nothrow) override final
Definition: all_defs.cpp:16176
end_apply_string_data_t(ptr_t str, size_t count) noexcept
Definition: all_defs.cpp:16064
virtual ptr_t get_substr_data(size_t begin, size_t size) noexcept override final
Definition: all_defs.cpp:16072
virtual void copy_part_data_to(char_T *to, size_t pos, size_t size) noexcept(copy_assign_nothrow) override final
Definition: all_defs.cpp:16125
virtual bool same_struct_equal(ptr_t with) noexcept(equal.nothrow< char_T >) override final
Definition: all_defs.cpp:16257
virtual hash_t get_hash_detail(ptr_t &) noexcept(hash_nothrow) override final
Definition: all_defs.cpp:16220
virtual void arec_set(size_t index, char_T a, ptr_t &p) noexcept(copy_assign_nothrow &&move_construct_nothrow) override final
Definition: all_defs.cpp:16148
virtual range_t< const char_T * > get_the_largest_complete_data_block_begin_form(size_t begin) noexcept override final
Definition: all_defs.cpp:16248
virtual char_T * get_c_str(ptr_t &p) noexcept(get_data_nothrow) override final
Definition: all_defs.cpp:16078
virtual ptr_t do_insert(size_t pos, string_view_t str) noexcept(copy_construct_nothrow) override final
Definition: all_defs.cpp:16095
virtual char_T arec(size_t index) noexcept(copy_construct_nothrow &&move_construct_nothrow) override final
Definition: all_defs.cpp:16142
end_apply_string_data_t(ptr_t str, size_t count, char_T ch) noexcept
Definition: all_defs.cpp:16056
virtual hash_t get_others_hash_with_calculated_before_detail(hash_t before, size_t before_size, ptr_t &, size_t pos, size_t size) noexcept(hash_nothrow) override final
Definition: all_defs.cpp:16223
virtual bool same_struct(ptr_t with) noexcept override final
Definition: all_defs.cpp:16244
virtual ptr_t do_pop_front(size_t size, ptr_t &self) noexcept(construct_nothrow &&copy_assign_nothrow) override final
Definition: all_defs.cpp:16200
virtual float_size_t get_base_memory_cost() noexcept override final
Definition: all_defs.cpp:16269
virtual ptr_t do_pop_back(size_t size, ptr_t &self) noexcept(construct_nothrow &&copy_assign_nothrow) override final
Definition: all_defs.cpp:16210
virtual ptr_t apply_str_to_begin(ptr_t str) noexcept(apply_data_nothrow) override final
Definition: all_defs.cpp:16190
virtual base_t::compare_type same_struct_compare(ptr_t with) noexcept(compare.nothrow< char_T >) override final
Definition: all_defs.cpp:16263
end_apply_string_data_t(ptr_t str, string_view_t end) noexcept(construct_nothrow &&copy_assign_nothrow)
Definition: all_defs.cpp:16048
virtual size_t get_size() noexcept override final
Definition: all_defs.cpp:16094
virtual bool same_struct_equal(ptr_t with) noexcept(equal.nothrow< char_T >) override final
Definition: all_defs.cpp:16734
virtual ptr_t apply_str_to_end(string_view_t str) noexcept(copy_construct_nothrow &&apply_data_nothrow) override final
Definition: all_defs.cpp:16652
virtual float_size_t get_base_memory_cost() noexcept override final
Definition: all_defs.cpp:16746
virtual void arec_set(size_t index, char_T a, ptr_t &p) noexcept(copy_assign_nothrow &&move_construct_nothrow) override final
Definition: all_defs.cpp:16617
virtual range_t< const char_T * > get_the_largest_complete_data_block_begin_form(size_t begin) noexcept override final
Definition: all_defs.cpp:16723
virtual void be_replace_as(ptr_t a) noexcept(clear_nothrow) override final
Definition: all_defs.cpp:16575
virtual hash_t get_others_hash_with_calculated_before_detail(hash_t before, size_t before_size, ptr_t &, size_t pos, size_t size) noexcept(hash_nothrow) override final
Definition: all_defs.cpp:16705
virtual size_t get_size() noexcept override final
Definition: all_defs.cpp:16584
virtual base_t::compare_type same_struct_compare(ptr_t with) noexcept(compare.nothrow< char_T >) override final
Definition: all_defs.cpp:16740
virtual void copy_part_data_to(char_T *to, size_t pos, size_t size) noexcept(copy_assign_nothrow) override final
Definition: all_defs.cpp:16586
virtual bool same_struct(ptr_t with) noexcept override final
Definition: all_defs.cpp:16719
virtual ptr_t apply_str_to_end(ptr_t str) noexcept(apply_data_nothrow) override final
Definition: all_defs.cpp:16662
virtual ptr_t do_erase(size_t pos, size_t size) noexcept override final
Definition: all_defs.cpp:16599
virtual ptr_t apply_str_to_begin(ptr_t str) noexcept(apply_data_nothrow) override final
Definition: all_defs.cpp:16640
virtual char_T arec(size_t index) noexcept(copy_construct_nothrow &&move_construct_nothrow) override final
Definition: all_defs.cpp:16610
virtual ptr_t do_pop_front(size_t size, ptr_t &self) noexcept(construct_nothrow &&copy_assign_nothrow) override final
Definition: all_defs.cpp:16672
virtual ptr_t get_substr_data(size_t begin, size_t size) noexcept override final
Definition: all_defs.cpp:16567
virtual ptr_t do_pop_back(size_t size, ptr_t &self) noexcept(construct_nothrow &&copy_assign_nothrow) override final
Definition: all_defs.cpp:16684
virtual hash_t get_hash_detail(ptr_t &) noexcept(hash_nothrow) override final
Definition: all_defs.cpp:16696
erased_string_data_t(ptr_t str, size_t erase_pos, size_t erase_size) noexcept
Definition: all_defs.cpp:16563
virtual ptr_t apply_str_to_begin(string_view_t str) noexcept(copy_construct_nothrow &&apply_data_nothrow) override final
Definition: all_defs.cpp:16628
virtual ptr_t apply_str_to_begin(ptr_t str) noexcept(apply_data_nothrow) override final
Definition: all_defs.cpp:15890
virtual void be_replace_as(ptr_t a) noexcept(clear_nothrow) override final
Definition: all_defs.cpp:15794
virtual size_t get_size() noexcept override final
Definition: all_defs.cpp:15804
virtual ptr_t apply_str_to_end(string_view_t str) noexcept(copy_construct_nothrow &&apply_data_nothrow) override final
Definition: all_defs.cpp:15897
head_apply_string_data_t(ptr_t str, string_view_t head) noexcept(construct_nothrow &&copy_assign_nothrow)
Definition: all_defs.cpp:15773
virtual bool same_struct(ptr_t with) noexcept override final
Definition: all_defs.cpp:15969
virtual char_T arec(size_t index) noexcept(copy_construct_nothrow &&move_construct_nothrow) override final
Definition: all_defs.cpp:15853
void shrink() noexcept(_m.forward_resize_nothrow)
Definition: all_defs.cpp:15894
virtual base_t::compare_type same_struct_compare(ptr_t with) noexcept(compare.nothrow< char_T >) override final
Definition: all_defs.cpp:15991
virtual void copy_part_data_to(char_T *to, size_t pos, size_t size) noexcept(copy_assign_nothrow) override final
Definition: all_defs.cpp:15835
virtual ptr_t do_insert(size_t pos, string_view_t str) noexcept(copy_construct_nothrow) override final
Definition: all_defs.cpp:15805
virtual ptr_t get_substr_data(size_t begin, size_t size) noexcept override final
Definition: all_defs.cpp:15782
virtual bool same_struct_equal(ptr_t with) noexcept(equal.nothrow< char_T >) override final
Definition: all_defs.cpp:15983
virtual hash_t get_others_hash_with_calculated_before_detail(hash_t before, size_t before_size, ptr_t &, size_t pos, size_t size) noexcept(hash_nothrow) override final
Definition: all_defs.cpp:15950
virtual hash_t get_hash_detail(ptr_t &) noexcept(hash_nothrow) override final
Definition: all_defs.cpp:15937
virtual range_t< const char_T * > get_the_largest_complete_data_block_begin_form(size_t begin) noexcept override final
Definition: all_defs.cpp:15973
virtual ptr_t apply_str_to_end(ptr_t str) noexcept(apply_data_nothrow) override final
Definition: all_defs.cpp:15907
virtual ptr_t do_pop_front(size_t size, ptr_t &self) noexcept(construct_nothrow &&copy_assign_nothrow) override final
Definition: all_defs.cpp:15917
virtual void arec_set(size_t index, char_T a, ptr_t &p) noexcept(copy_assign_nothrow &&move_construct_nothrow) override final
Definition: all_defs.cpp:15861
virtual char_T * get_c_str(ptr_t &p) noexcept(get_data_nothrow) override final
Definition: all_defs.cpp:15788
virtual ptr_t do_pop_back(size_t size, ptr_t &self) noexcept(construct_nothrow &&copy_assign_nothrow) override final
Definition: all_defs.cpp:15926
virtual ptr_t apply_str_to_begin(string_view_t str) noexcept(copy_construct_nothrow &&apply_data_nothrow) override final
Definition: all_defs.cpp:15874
virtual float_size_t get_base_memory_cost() noexcept override final
Definition: all_defs.cpp:15999
virtual bool same_struct_equal(ptr_t with) noexcept(equal.nothrow< char_T >) override final
Definition: all_defs.cpp:17064
virtual ptr_t do_insert(size_t pos, string_view_t str) noexcept(copy_construct_nothrow) override final
Definition: all_defs.cpp:16845
virtual char_T arec(size_t index) noexcept(copy_construct_nothrow &&move_construct_nothrow) override final
Definition: all_defs.cpp:16889
virtual void be_replace_as(ptr_t a) noexcept(clear_nothrow) override final
Definition: all_defs.cpp:16808
virtual ptr_t do_pop_front(size_t size, ptr_t &self) noexcept(construct_nothrow &&copy_assign_nothrow) override final
Definition: all_defs.cpp:16979
virtual ptr_t apply_str_to_begin(ptr_t str) noexcept(apply_data_nothrow) override final
Definition: all_defs.cpp:16929
virtual hash_t get_others_hash_with_calculated_before_detail(hash_t before, size_t before_size, ptr_t &, size_t pos, size_t size) noexcept(hash_nothrow) override final
Definition: all_defs.cpp:17026
virtual bool same_struct(ptr_t with) noexcept override final
Definition: all_defs.cpp:17048
virtual void copy_part_data_to(char_T *to, size_t pos, size_t size) noexcept(copy_assign_nothrow) override final
Definition: all_defs.cpp:16824
virtual hash_t get_hash_detail(ptr_t &) noexcept(hash_nothrow) override final
Definition: all_defs.cpp:17015
virtual size_t get_size() noexcept override final
Definition: all_defs.cpp:16822
inserted_string_data_t(ptr_t to, ptr_t insert_data, size_t insert_pos) noexcept
Definition: all_defs.cpp:16796
virtual ptr_t get_substr_data(size_t begin, size_t size) noexcept override final
Definition: all_defs.cpp:16798
virtual ptr_t apply_str_to_end(ptr_t str) noexcept(apply_data_nothrow) override final
Definition: all_defs.cpp:16963
virtual ptr_t apply_str_to_begin(string_view_t str) noexcept(copy_construct_nothrow &&apply_data_nothrow) override final
Definition: all_defs.cpp:16911
virtual range_t< const char_T * > get_the_largest_complete_data_block_begin_form(size_t index) noexcept override final
Definition: all_defs.cpp:17052
virtual ptr_t do_erase(size_t pos, size_t size) noexcept override final
Definition: all_defs.cpp:16865
virtual void arec_set(size_t index, char_T a, ptr_t &p) noexcept(copy_assign_nothrow &&move_construct_nothrow) override final
Definition: all_defs.cpp:16898
virtual ptr_t apply_str_to_end(string_view_t str) noexcept(copy_construct_nothrow &&apply_data_nothrow) override final
Definition: all_defs.cpp:16947
virtual base_t::compare_type same_struct_compare(ptr_t with) noexcept(compare.nothrow< char_T >) override final
Definition: all_defs.cpp:17070
virtual float_size_t get_base_memory_cost() noexcept override final
Definition: all_defs.cpp:17078
virtual ptr_t do_pop_back(size_t size, ptr_t &self) noexcept(construct_nothrow &&copy_assign_nothrow) override final
Definition: all_defs.cpp:16997
virtual range_t< const char_T * > get_the_largest_complete_data_block_begin_form(size_t begin) noexcept override final
Definition: all_defs.cpp:15269
virtual hash_t get_hash_detail(ptr_t &p) noexcept override final
Definition: all_defs.cpp:15265
virtual void copy_part_data_to(char_T *to, size_t pos, size_t size) noexcept override final
Definition: all_defs.cpp:15258
virtual size_t get_size() noexcept override final
Definition: all_defs.cpp:15247
virtual hash_t get_others_hash_with_calculated_before_detail(hash_t before, size_t before_size, ptr_t &p, size_t pos, size_t size) noexcept override final
Definition: all_defs.cpp:15266
virtual void be_replace_as(ptr_t a) noexcept(clear_nothrow) override final
Definition: all_defs.cpp:15242
virtual char_T * get_c_str(ptr_t &) noexcept override final
Definition: all_defs.cpp:15243
virtual ptr_t apply_str_to_begin(string_view_t str) noexcept(copy_construct_nothrow &&apply_data_nothrow) override final
Definition: all_defs.cpp:15249
virtual base_t::compare_type same_struct_compare(ptr_t with) noexcept override final
Definition: all_defs.cpp:15271
virtual ptr_t apply_str_to_begin(ptr_t str) noexcept(apply_data_nothrow) override final
Definition: all_defs.cpp:15250
virtual void arec_set(size_t index, char_T a, ptr_t &p) noexcept override final
Definition: all_defs.cpp:15261
virtual ptr_t get_substr_data(size_t begin, size_t size) noexcept override final
Definition: all_defs.cpp:15248
virtual ptr_t do_erase(size_t pos, size_t size) noexcept override final
Definition: all_defs.cpp:15256
virtual ptr_t apply_str_to_end(string_view_t str) noexcept(copy_construct_nothrow &&apply_data_nothrow) override final
Definition: all_defs.cpp:15251
virtual ptr_t apply_str_to_end(ptr_t str) noexcept override final
Definition: all_defs.cpp:15252
virtual ptr_t do_pop_front(size_t size, ptr_t &self) noexcept override final
Definition: all_defs.cpp:15263
virtual ptr_t do_insert(size_t pos, string_view_t str) noexcept(construct_nothrow &&copy_assign_nothrow) override final
Definition: all_defs.cpp:15254
virtual ptr_t do_pop_back(size_t size, ptr_t &self) noexcept override final
Definition: all_defs.cpp:15262
virtual float_size_t get_base_memory_cost() noexcept override final
Definition: all_defs.cpp:15272
virtual ptr_t do_insert(size_t pos, ptr_t str) noexcept override final
Definition: all_defs.cpp:15255
virtual char_T arec(size_t index) noexcept override final
Definition: all_defs.cpp:15260
virtual bool same_struct_equal(ptr_t with) noexcept override final
Definition: all_defs.cpp:15270
virtual bool same_struct(ptr_t) noexcept override final
Definition: all_defs.cpp:15268
virtual hash_t get_others_hash_with_calculated_before_detail(hash_t before, size_t before_size, ptr_t &, size_t pos, size_t size) noexcept(hash_nothrow) override final
Definition: all_defs.cpp:17176
virtual bool same_struct_equal(ptr_t with) noexcept(equal.nothrow< char_T >) override final
Definition: all_defs.cpp:17194
virtual base_t::compare_type same_struct_compare(ptr_t with) noexcept(compare.nothrow< char_T >) override final
Definition: all_defs.cpp:17198
virtual char_T arec(size_t index) noexcept(copy_construct_nothrow &&move_construct_nothrow) override final
Definition: all_defs.cpp:17148
virtual float_size_t get_base_memory_cost() noexcept override final
Definition: all_defs.cpp:17202
virtual void copy_part_data_to(char_T *to, size_t pos, size_t size) noexcept(copy_assign_nothrow) override final
Definition: all_defs.cpp:17144
virtual ptr_t do_pop_front(size_t size, ptr_t &) noexcept(construct_nothrow &&copy_assign_nothrow) override final
Definition: all_defs.cpp:17154
virtual void arec_set(size_t index, char_T a, ptr_t &p) noexcept(copy_assign_nothrow &&move_construct_nothrow) override final
Definition: all_defs.cpp:17151
virtual range_t< const char_T * > get_the_largest_complete_data_block_begin_form(size_t begin) noexcept override final
Definition: all_defs.cpp:17183
virtual hash_t get_hash_detail(ptr_t &) noexcept(hash_nothrow) override final
Definition: all_defs.cpp:17173
virtual ptr_t get_substr_data(size_t begin, size_t size) noexcept override final
Definition: all_defs.cpp:17139
virtual void be_replace_as(ptr_t a) noexcept(clear_nothrow) override final
Definition: all_defs.cpp:17136
virtual bool same_struct(ptr_t with) noexcept override final
Definition: all_defs.cpp:17180
virtual ptr_t do_pop_back(size_t size, ptr_t &) noexcept(construct_nothrow &&copy_assign_nothrow) override final
Definition: all_defs.cpp:17163
substr_string_data_t(ptr_t str, size_t sub_begin, size_t sub_size) noexcept
Definition: all_defs.cpp:15605
virtual const char_T * get_const_c_str(ptr_t &p) noexcept(get_data_nothrow) override final
Definition: all_defs.cpp:15614
virtual ptr_t apply_str_to_begin(ptr_t str) noexcept(apply_data_nothrow) override final
Definition: all_defs.cpp:15644
virtual const char_T * get_data(ptr_t &) noexcept(get_data_nothrow) override final
Definition: all_defs.cpp:15620
virtual ptr_t do_pop_back(size_t size, ptr_t &self) noexcept(construct_nothrow &&copy_assign_nothrow) override final
Definition: all_defs.cpp:15685
virtual void arec_set(size_t index, char_T a, ptr_t &p) noexcept(copy_assign_nothrow &&move_construct_nothrow) override final
Definition: all_defs.cpp:15626
virtual base_t::compare_type same_struct_compare(ptr_t with) noexcept(compare.nothrow< char_T >) override final
Definition: all_defs.cpp:15719
virtual range_t< const char_T * > get_the_largest_complete_data_block_begin_form(size_t begin) noexcept override final
Definition: all_defs.cpp:15710
virtual float_size_t get_base_memory_cost() noexcept override final
Definition: all_defs.cpp:15723
virtual bool same_struct_equal(ptr_t with) noexcept(equal.nothrow< char_T >) override final
Definition: all_defs.cpp:15715
virtual hash_t get_hash_detail(ptr_t &) noexcept(hash_nothrow) override final
Definition: all_defs.cpp:15697
virtual char_T arec(size_t index) noexcept(copy_construct_nothrow &&move_construct_nothrow) override final
Definition: all_defs.cpp:15625
virtual size_t get_size() noexcept override final
Definition: all_defs.cpp:15621
virtual bool same_struct(ptr_t with) noexcept override final
Definition: all_defs.cpp:15706
virtual ptr_t apply_str_to_begin(string_view_t str) noexcept(copy_construct_nothrow &&apply_data_nothrow) override final
Definition: all_defs.cpp:15634
virtual void be_replace_as(ptr_t a) noexcept(clear_nothrow) override final
Definition: all_defs.cpp:15609
virtual ptr_t apply_str_to_end(ptr_t str) noexcept(apply_data_nothrow) override final
Definition: all_defs.cpp:15664
virtual ptr_t apply_str_to_end(string_view_t str) noexcept(copy_construct_nothrow &&apply_data_nothrow) override final
Definition: all_defs.cpp:15654
virtual ptr_t get_substr_data(size_t begin, size_t size) noexcept override final
Definition: all_defs.cpp:15613
virtual ptr_t do_pop_front(size_t size, ptr_t &self) noexcept(construct_nothrow &&copy_assign_nothrow) override final
Definition: all_defs.cpp:15674
virtual void copy_part_data_to(char_T *to, size_t pos, size_t size) noexcept(copy_assign_nothrow) override final
Definition: all_defs.cpp:15623
virtual hash_t get_others_hash_with_calculated_before_detail(hash_t before, size_t before_size, ptr_t &, size_t pos, size_t size) noexcept(hash_nothrow) override final
Definition: all_defs.cpp:15702
virtual ptr_t apply_str_to_end(string_view_t str) noexcept(copy_construct_nothrow &&apply_data_nothrow) override final
Definition: all_defs.cpp:16403
virtual char_T arec(size_t index) noexcept(copy_construct_nothrow &&move_construct_nothrow) override final
Definition: all_defs.cpp:16366
virtual ptr_t do_pop_back(size_t size, ptr_t &self) noexcept(construct_nothrow &&copy_assign_nothrow) override final
Definition: all_defs.cpp:16439
sum_string_data_t(ptr_t before, ptr_t after) noexcept
Definition: all_defs.cpp:16319
virtual ptr_t apply_str_to_end(ptr_t str) noexcept(apply_data_nothrow) override final
Definition: all_defs.cpp:16413
virtual hash_t get_others_hash_with_calculated_before_detail(hash_t before, size_t before_size, ptr_t &, size_t pos, size_t size) noexcept(hash_nothrow) override final
Definition: all_defs.cpp:16468
virtual bool same_struct(ptr_t with) noexcept override final
Definition: all_defs.cpp:16485
virtual ptr_t do_pop_front(size_t size, ptr_t &self) noexcept(construct_nothrow &&copy_assign_nothrow) override final
Definition: all_defs.cpp:16423
virtual ptr_t apply_str_to_begin(string_view_t str) noexcept(copy_construct_nothrow &&apply_data_nothrow) override final
Definition: all_defs.cpp:16383
virtual void be_replace_as(ptr_t a) noexcept(clear_nothrow) override final
Definition: all_defs.cpp:16334
virtual hash_t get_hash_detail(ptr_t &) noexcept(hash_nothrow) override final
Definition: all_defs.cpp:16456
virtual bool same_struct_equal(ptr_t with) noexcept(equal.nothrow< char_T >) override final
Definition: all_defs.cpp:16495
virtual ptr_t apply_str_to_begin(ptr_t str) noexcept(apply_data_nothrow) override final
Definition: all_defs.cpp:16393
virtual base_t::compare_type same_struct_compare(ptr_t with) noexcept(compare.nothrow< char_T >) override final
Definition: all_defs.cpp:16501
virtual range_t< const char_T * > get_the_largest_complete_data_block_begin_form(size_t begin) noexcept override final
Definition: all_defs.cpp:16489
virtual float_size_t get_base_memory_cost() noexcept override final
Definition: all_defs.cpp:16507
virtual void arec_set(size_t index, char_T a, ptr_t &p) noexcept(copy_assign_nothrow &&move_construct_nothrow) override final
Definition: all_defs.cpp:16372
virtual size_t get_size() noexcept override final
Definition: all_defs.cpp:16348
virtual void copy_part_data_to(char_T *to, size_t pos, size_t size) noexcept(copy_assign_nothrow) override final
Definition: all_defs.cpp:16350
virtual ptr_t get_substr_data(size_t begin, size_t size) noexcept override final
Definition: all_defs.cpp:16326
void push_front(string_view_t str) &noexcept
Definition: all_defs.cpp:17760
string_t & operator=(string_t &&str) noexcept
Definition: all_defs.cpp:17367
size_t find(const string_t &str, size_t begin=0) const noexcept(find_nothrow)
Definition: all_defs.cpp:17798
constexpr bool ends_with(const char_T *str) const noexcept
Definition: all_defs.cpp:18055
void arec_set(size_t index, char_T a) noexcept
Definition: all_defs.cpp:17520
float_size_t memory_cost() const noexcept
Definition: all_defs.cpp:17418
string_t arec(size_t index, constexpr_str_t &delimiter_str) const
Definition: all_defs.cpp:17951
size_t find_first_of(const string_t &str) const noexcept(find_nothrow)
Definition: all_defs.cpp:17831
string_t(string_view_t str) noexcept
Definition: all_defs.cpp:17343
size_t size() const noexcept
Definition: all_defs.cpp:17656
string_t & operator=(const string_t &str) noexcept
Definition: all_defs.cpp:17366
size_t reverse_find(const char_T ch) const noexcept(find_nothrow)
Definition: all_defs.cpp:17783
constexpr bool starts_with(constexpr_str_t &str) const noexcept
Definition: all_defs.cpp:18009
string_t operator+(const string_t &str) const noexcept
Definition: all_defs.cpp:17373
string_t & operator+=(string_view_t str) &noexcept
Definition: all_defs.cpp:17400
size_t find_last_of(const string_t &str) const noexcept(find_nothrow)
Definition: all_defs.cpp:17879
size_t find_last_of(const arec_t &&ch) const noexcept(find_nothrow)
Definition: all_defs.cpp:17894
constexpr auto operator<=>(string_view_t a) const noexcept(compare.nothrow< char_T >)
Definition: all_defs.cpp:17460
reverse_iterator_t< char_T, iterator_base_t > reverse_iterator
Definition: all_defs.cpp:17715
char_T pop_front() noexcept
Definition: all_defs.cpp:17768
constexpr auto operator<=>(const char_T *a) const noexcept(compare.nothrow< char_T >)
Definition: all_defs.cpp:17498
const char_T * data() const noexcept
Definition: all_defs.cpp:17652
constexpr bool ends_with(constexpr_str_t &str) const noexcept
Definition: all_defs.cpp:18037
char_T * writeable_data() noexcept
Definition: all_defs.cpp:17653
const_iterator cbegin() const noexcept
Definition: all_defs.cpp:17710
size_t find_first_not_of(char_T ch) const noexcept(find_nothrow)
Definition: all_defs.cpp:17867
constexpr auto operator==(const char_T *a) const noexcept(equal.nothrow< char_T >)
Definition: all_defs.cpp:17504
void push_front(const arec_t &&ch) &noexcept
Definition: all_defs.cpp:17762
size_t find_last_not_of(const arec_t &&ch) const noexcept(find_nothrow)
Definition: all_defs.cpp:17918
void resize(size_t nsize) noexcept
Definition: all_defs.cpp:17673
const arec_t front() const noexcept
Definition: all_defs.cpp:17553
size_t find_last_of(constexpr_str_t &str) const noexcept(find_nothrow)
Definition: all_defs.cpp:17876
this_t & append(size_t size, char_T ch) noexcept
Definition: all_defs.cpp:18059
constexpr string_t() noexcept
Definition: all_defs.cpp:17341
size_t find_first_of(const arec_t &&ch) const noexcept(find_nothrow)
Definition: all_defs.cpp:17846
size_t length() const noexcept
Definition: all_defs.cpp:17659
size_t find_first_of(constexpr_str_t &str) const noexcept(find_nothrow)
Definition: all_defs.cpp:17828
constexpr auto operator==(constexpr_str_t &a) const noexcept(equal.nothrow< char_T >)
Definition: all_defs.cpp:17490
constexpr bool starts_with(const char_T *str) const noexcept
Definition: all_defs.cpp:18027
size_t find(string_view_t str, size_t begin=0) const noexcept(find_nothrow)
Definition: all_defs.cpp:17786
iterator get_iterator_at(ptrdiff_t index) noexcept
Definition: all_defs.cpp:17706
friend string_t operator+(char_T ch, const string_t &str) noexcept
Definition: all_defs.cpp:17392
reverse_const_iterator rcbegin() const noexcept
Definition: all_defs.cpp:17722
friend string_t operator+(const char_T *str1, const string_t &str2) noexcept
Definition: all_defs.cpp:17389
size_t reverse_find(const string_t &str) const noexcept(find_nothrow)
Definition: all_defs.cpp:17811
base_t_w::string_view_t string_view_t
Definition: all_defs.cpp:17221
size_t find(constexpr_str_t &str, size_t begin=0) const noexcept(find_nothrow)
Definition: all_defs.cpp:17792
const_iterator_t< char_T, const iterator_base_t > const_iterator
Definition: all_defs.cpp:17704
size_t find_last_not_of(const string_t &str) const noexcept(find_nothrow)
Definition: all_defs.cpp:17903
const floating_arec_t operator[](float_t index) const noexcept
Definition: all_defs.cpp:17625
size_t reverse_find(constexpr_str_t &str) const noexcept(find_nothrow)
Definition: all_defs.cpp:17795
bool empty() const noexcept
Definition: all_defs.cpp:17658
requires ::std::is_arithmetic_v< T > auto operator[](T index) noexcept
Definition: all_defs.cpp:17629
const arec_t operator[](size_t index) const noexcept
Definition: all_defs.cpp:17549
size_t find_first_of(char_T ch) const noexcept(find_nothrow)
Definition: all_defs.cpp:17843
string_t & operator+=(const string_t &str) &noexcept
Definition: all_defs.cpp:17396
reverse_const_iterator rbegin() const noexcept
Definition: all_defs.cpp:17721
void push_back(char_T ch) &noexcept
Definition: all_defs.cpp:17743
constexpr bool contains(char_T ch) const noexcept
Definition: all_defs.cpp:17996
string_t(const char_T *str) noexcept
Definition: all_defs.cpp:17344
constexpr bool starts_with(char_T ch) const noexcept
Definition: all_defs.cpp:18022
string_t(size_t size) noexcept
Definition: all_defs.cpp:17360
constexpr auto operator<=>(const string_t &a) const noexcept(compare.nothrow< char_T >)
Definition: all_defs.cpp:17426
constexpr bool ends_with(const string_t &str) const noexcept
Definition: all_defs.cpp:18042
void insert(size_t pos, const string_t &str) &noexcept
Definition: all_defs.cpp:17966
string_t(char_T ch, size_t size) noexcept
Definition: all_defs.cpp:17358
void push_front(const string_t &str) &noexcept
Definition: all_defs.cpp:17747
size_t find_first_of(const char_T *str) const noexcept(find_nothrow)
Definition: all_defs.cpp:17840
void push_back(const char_T *str) &noexcept
Definition: all_defs.cpp:17745
auto view() const &noexcept
Definition: all_defs.cpp:17775
size_t reverse_find(string_view_t str) const noexcept(find_nothrow)
Definition: all_defs.cpp:17789
string_t< char_T > this_t
Definition: all_defs.cpp:17223
const_iterator end() const noexcept
Definition: all_defs.cpp:17712
reverse_const_iterator get_reverse_iterator_at(ptrdiff_t index) const noexcept
Definition: all_defs.cpp:17719
size_t find_first_not_of(const string_t &str) const noexcept(find_nothrow)
Definition: all_defs.cpp:17855
size_t find_first_not_of(string_view_t str) const noexcept(find_nothrow)
Definition: all_defs.cpp:17849
constexpr bool starts_with(const string_t &str) const noexcept
Definition: all_defs.cpp:18014
string_t(string_t &&str) noexcept
Definition: all_defs.cpp:17354
string_t && operator+(U &&b) &&noexcept(noexcept((*this+=b)))
Definition: all_defs.cpp:17411
constexpr bool contains(const char_T *str) const noexcept
Definition: all_defs.cpp:17999
void push_back(const string_t &str) &noexcept
Definition: all_defs.cpp:17729
iterator_t< char_T, iterator_base_t > iterator
Definition: all_defs.cpp:17703
constexpr auto operator<=>(constexpr_str_t &a) const noexcept(compare.nothrow< char_T >)
Definition: all_defs.cpp:17482
size_t find_first_not_of(constexpr_str_t &str) const noexcept(find_nothrow)
Definition: all_defs.cpp:17852
reverse_const_iterator rend() const noexcept
Definition: all_defs.cpp:17724
void insert(size_t pos, const char_T *str) &noexcept
Definition: all_defs.cpp:17977
arec_t operator[](size_t index) noexcept
Definition: all_defs.cpp:17548
constexpr bool contains(string_view_t str) const noexcept
Definition: all_defs.cpp:17987
string_t pop_front(size_t size) noexcept
Definition: all_defs.cpp:17766
const arec_t back() const noexcept
Definition: all_defs.cpp:17556
void insert(size_t pos, string_view_t str) &noexcept
Definition: all_defs.cpp:17974
iterator begin() noexcept
Definition: all_defs.cpp:17708
char_T * writeable_c_str() noexcept
Definition: all_defs.cpp:17655
size_t find_last_of(string_view_t str) const noexcept(find_nothrow)
Definition: all_defs.cpp:17873
string_t(size_t size, char_T ch) noexcept
Definition: all_defs.cpp:17357
floating_arec_t operator[](float_t index) noexcept
Definition: all_defs.cpp:17624
size_t find_first_not_of(const arec_t &&ch) const noexcept(find_nothrow)
Definition: all_defs.cpp:17870
base_string_data_t< char_T > base_t_w
Definition: all_defs.cpp:17219
string_t arec(size_t index, char_T delimiter) const
Definition: all_defs.cpp:17924
void erase(size_t pos, size_t size=1) &noexcept
Definition: all_defs.cpp:17963
iterator end() noexcept
Definition: all_defs.cpp:17711
reverse_iterator rbegin() noexcept
Definition: all_defs.cpp:17720
void resize(size_t nsize, char_T ch) noexcept
Definition: all_defs.cpp:17660
string_t operator+(const arec_t &&ch) const noexcept
Definition: all_defs.cpp:17559
constexpr bool contains(constexpr_str_t &str) const noexcept
Definition: all_defs.cpp:17990
string_t arec(size_t index, const string_t &delimiter_str) const
Definition: all_defs.cpp:17942
void push_front(const char_T *str) &noexcept
Definition: all_defs.cpp:17763
size_t find_first_of(string_view_t str) const noexcept(find_nothrow)
Definition: all_defs.cpp:17825
size_t find_last_not_of(char_T ch) const noexcept(find_nothrow)
Definition: all_defs.cpp:17915
string_t & operator+=(const arec_t &&ch) &noexcept
Definition: all_defs.cpp:17562
char_T arec(size_t index) noexcept
Definition: all_defs.cpp:17514
string_t substr(size_t begin, size_t size=npos) const noexcept
Definition: all_defs.cpp:17643
const constexpr_str_t< char_T > constexpr_str_t
Definition: all_defs.cpp:17222
void swap_with(this_t &a) noexcept
Definition: all_defs.cpp:17331
string_t pop_back(size_t size) noexcept
Definition: all_defs.cpp:17765
void insert(size_t pos, char_T ch) &noexcept
Definition: all_defs.cpp:17980
reverse_const_iterator rcend() const noexcept
Definition: all_defs.cpp:17725
string_t arec(size_t index, string_view_t delimiter_str) const
Definition: all_defs.cpp:17933
requires ::std::is_arithmetic_v< T > const auto operator[](T index) const noexcept
Definition: all_defs.cpp:17636
size_t find_last_not_of(string_view_t str) const noexcept(find_nothrow)
Definition: all_defs.cpp:17897
string_t & operator+=(char_T ch) &noexcept
Definition: all_defs.cpp:17407
size_t find_last_of(const char_T *str) const noexcept(find_nothrow)
Definition: all_defs.cpp:17888
size_t find_last_not_of(constexpr_str_t &str) const noexcept(find_nothrow)
Definition: all_defs.cpp:17900
constexpr auto operator==(string_view_t a) const noexcept(equal.nothrow< char_T >)
Definition: all_defs.cpp:17471
constexpr bool contains(const string_t &str) const noexcept
Definition: all_defs.cpp:17993
char_T pop_back() noexcept
Definition: all_defs.cpp:17767
void push_back(const arec_t &&ch) &noexcept
Definition: all_defs.cpp:17744
const_iterator get_iterator_at(ptrdiff_t index) const noexcept
Definition: all_defs.cpp:17707
void push_back(string_view_t str) &noexcept
Definition: all_defs.cpp:17742
string_t & operator+=(const char_T *str) &noexcept
Definition: all_defs.cpp:17404
constexpr bool ends_with(char_T ch) const noexcept
Definition: all_defs.cpp:18050
constexpr bool ends_with(string_view_t str) const noexcept
Definition: all_defs.cpp:18032
size_t find_first_not_of(const char_T *str) const noexcept(find_nothrow)
Definition: all_defs.cpp:17864
constexpr bool starts_with(string_view_t str) const noexcept
Definition: all_defs.cpp:18004
const_iterator begin() const noexcept
Definition: all_defs.cpp:17709
string_t operator+(const char_T *str) const noexcept
Definition: all_defs.cpp:17383
string_t operator+(string_view_t str) const noexcept
Definition: all_defs.cpp:17380
void push_front(char_T ch) &noexcept
Definition: all_defs.cpp:17761
string_t(const string_t &str) noexcept
Definition: all_defs.cpp:17346
size_t find_last_of(char_T ch) const noexcept(find_nothrow)
Definition: all_defs.cpp:17891
const char_T * c_str() const noexcept
Definition: all_defs.cpp:17654
size_t find(const char_T ch, size_t begin=0) const noexcept(find_nothrow)
Definition: all_defs.cpp:17780
auto to_string_view_t() const &noexcept
Definition: all_defs.cpp:17773
const_iterator cend() const noexcept
Definition: all_defs.cpp:17713
reverse_iterator rend() noexcept
Definition: all_defs.cpp:17723
friend string_t operator+(string_view_t str1, const string_t &str2) noexcept
Definition: all_defs.cpp:17386
constexpr string_t(char_T ch) noexcept
Definition: all_defs.cpp:17345
reverse_iterator get_reverse_iterator_at(ptrdiff_t index) noexcept
Definition: all_defs.cpp:17718
constexpr string_t & operator=(char_T ch) noexcept
Definition: all_defs.cpp:17369
constexpr auto operator==(const string_t &a) const noexcept(equal.nothrow< char_T >)
Definition: all_defs.cpp:17443
constexpr string_t(constexpr_str_t &str) noexcept
Definition: all_defs.cpp:17342
size_t find_last_not_of(const char_T *str) const noexcept(find_nothrow)
Definition: all_defs.cpp:17912
reverse_const_iterator_t< char_T, const iterator_base_t > reverse_const_iterator
Definition: all_defs.cpp:17716
constexpr string_t & operator=(constexpr_str_t &str) noexcept
Definition: all_defs.cpp:17368